Code example for DialogFragment

Methods: getActivity, getArguments, getTag

    return dialogFragment;
  //KEY_ROWID + " != " + getArguments().getLong("fromAccountId") 
  public Dialog onCreateDialog(Bundle savedInstanceState) {
    Context ctx = getActivity();
    Bundle bundle = getArguments();
    String column = bundle.getString("column");
    Cursor c = ((SelectFromCursorDialogListener) ctx).getCursor(bundle.getInt("cursorId"),getTag());
    mAdapter = new SimpleCursorAdapter(ctx, android.R.layout.select_dialog_singlechoice,
        c, new String[]{column}, new int[]{},0);
    return new AlertDialog.Builder(ctx)
  public void onClick(DialogInterface dialog, int which) {
    SelectFromCursorDialogListener activity = (SelectFromCursorDialogListener) getActivity();
    Bundle args = getArguments();
Connect your IDE to all the code out there  Get Codota for Java