コード例 #1
0
  public void showDialog(Bundle params) {
    // 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 = getChildFragmentManager().beginTransaction();
    Fragment prev = getChildFragmentManager().findFragmentByTag("dialog");
    if (prev != null) {
      ft.remove(prev);
    }
    ft.addToBackStack(null);

    // Create and show the dialog.
    CommonDialogFragment newFragment = CommonDialogFragment.newInstance(params);
    newFragment.show(ft, "dialog");
  }
コード例 #2
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setStyle(STYLE_NORMAL, R.style.Theme_OpenPhoto_Dialog_Light);
   setDialogType(DialogType.AlertDialog);
 }