android.app.DialogFragment
官方文档,介绍了很多方法的使用:
void dismiss()
Dismiss the fragment and its dialog.
void dismissAllowingStateLoss()
Version of dismiss() that uses FragmentTransaction.commitAllowingStateLoss().
Dialog getDialog()
boolean getShowsDialog()
Return the current value of setShowsDialog(boolean).
int getTheme()
boolean isCancelable()
Return the current value of setCancelable(boolean).
void onActivityCreated(Bundle savedInstanceState)
Called when the fragment's activity has been created and this fragment's view hierarchy instantiated.
void onAttach(Context context)
Called when a fragment is first attached to its context.
void onCancel(DialogInterface dialog)
This method will be invoked when the dialog is canceled.
void onCreate(Bundle savedInstanceState)
Called to do initial creation of a fragment.
Dialog onCreateDialog(Bundle savedInstanceState)
Override to build your own custom Dialog container.
void onDestroyView()
Remove dialog.
void onDetach()
Called when the fragment is no longer attached to its activity.
void onDismiss(DialogInterface dialog)
This method will be invoked when the dialog is dismissed.
void onSaveInstanceState(Bundle outState)
Called to ask the fragment to save its current dynamic state, so it can later be reconstructed in a new instance of its process is restarted.
void onStart()
Called when the Fragment is visible to the user.
void onStop()
Called when the Fragment is no longer started.
void setCancelable(boolean cancelable)
Control whether the shown Dialog is cancelable.
void setShowsDialog(boolean showsDialog)
Controls whether this fragment should be shown in a dialog.
void setStyle(int style, int theme)
Call to customize the basic appearance and behavior of the fragment's dialog.
int show(FragmentTransaction transaction, String tag)
Display the dialog, adding the fragment using an existing transaction and then committing the transaction.
void show(FragmentManager manager, String tag)
Display the dialog, adding the fragment to the