public static MyDialogFragment newInstance(String title) { MyDialogFragment frag = new MyDialogFragment(); Bundle args = new Bundle(); args.putString("text", title); frag.setArguments(args); return frag; }
private void popUpAlertDialog(String eventName) { Bundle b = new Bundle(); b.putParcelable("USER", thisUser); Intent thisIntent = new Intent(getActivity().getBaseContext(), MainActivity.class); thisIntent.putExtras(b); b.putString("TITLE", "Event Not Found!"); b.putString("EVENTNAME", eventName); MyDialogFragment fragment = new MyDialogFragment(); fragment.setArguments(b); FragmentManager frgManager = getFragmentManager(); fragment.show(frgManager, "MyDialog"); }
void showDialog(String text) { // DialogFragment.show() will take care of adding the fragment // in a transaction. We also want to remove any currently showing // dialog, so make our own transaction and take care of that here. FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); DialogFragment newFragment = MyDialogFragment.newInstance(text); // Show the dialog. newFragment.show(ft, "dialog"); }
void showDialog2(int i) { // dialog, so make our own transaction and take care of that here. FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); Fragment prev = getSupportFragmentManager().findFragmentByTag("dialog"); if (prev != null) { Log.d(TAG, "dialog is already showing!!!"); // DialogFragment df = (DialogFragment) prev; // df.dismiss(); ft.remove(prev); } // Create and show the dialog. DialogFragment newFragment = MyDialogFragment.newInstance(i); newFragment.show(ft, "dialog"); }
public void createWarningDialog(String msg) { MyDialogFragment dialogfragment = (MyDialogFragment) MyDialogFragment.newInstance(this, msg); dialogfragment.show(fm, "dialog2"); }
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { super.onCreateDialog(savedInstanceState); return builder.create(); }
static MyDialogFragment newInstance(int i) { MyDialogFragment f = new MyDialogFragment(); f.i = i; return f; }