コード例 #1
0
 public static MyDialogFragment newInstance(String title) {
   MyDialogFragment frag = new MyDialogFragment();
   Bundle args = new Bundle();
   args.putString("text", title);
   frag.setArguments(args);
   return frag;
 }
コード例 #2
0
 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");
 }
コード例 #3
0
  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");
  }
コード例 #4
0
ファイル: SimpleActivity.java プロジェクト: hchaojie/snippets
  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");
  }
コード例 #5
0
  public void createWarningDialog(String msg) {

    MyDialogFragment dialogfragment = (MyDialogFragment) MyDialogFragment.newInstance(this, msg);
    dialogfragment.show(fm, "dialog2");
  }
コード例 #6
0
ファイル: AdjustGainDialog.java プロジェクト: stekreis/AnSiAn
 @Override
 public Dialog onCreateDialog(Bundle savedInstanceState) {
   super.onCreateDialog(savedInstanceState);
   return builder.create();
 }
コード例 #7
0
ファイル: SimpleActivity.java プロジェクト: hchaojie/snippets
 static MyDialogFragment newInstance(int i) {
   MyDialogFragment f = new MyDialogFragment();
   f.i = i;
   return f;
 }