private void showEditDialog(final ViewHolder holder) { if (LOG) { MtkLog.v(TAG, "showEditDialog(" + holder + ")"); } if (holder == null) { return; } final LayoutInflater inflater = LayoutInflater.from(this); final View v = inflater.inflate(R.layout.bookmark_edit_dialog, null); final EditText titleView = (EditText) v.findViewById(R.id.title); final EditText dataView = (EditText) v.findViewById(R.id.data); titleView.setText(holder.mTitle); dataView.setText(holder.mData); final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.edit); builder.setView(v); builder.setIcon(R.drawable.ic_menu_display_bookmark); builder.setPositiveButton( android.R.string.ok, new OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { mBookmark.update( holder.mId, titleView.getText().toString(), dataView.getText().toString(), 0); } }); builder.setNegativeButton(android.R.string.cancel, null); final AlertDialog dialog = builder.create(); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); dialog.setInverseBackgroundForced(true); dialog.show(); }
@Override protected void onPostExecute(Void result) { if (progressDialog != null) { progressDialog.cancel(); } if (!error) { restaurant.setCompleteDataLoaded(Boolean.TRUE); } dialog = new AlertDialog.Builder(activity).create(); dialog.setInverseBackgroundForced(true); View view = createAndFillDataMovementLayout(restaurant, position); dialog.setView(view); dialog.show(); dialog.setOnDismissListener( new DialogInterface.OnDismissListener() { public void onDismiss(DialogInterface dialog) { dialog.cancel(); } }); }