Code example for DialogFragment

Methods: dismissonCreate, getActivity, getArguments

-1
		return dialog;
	} 
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mCorrect = getArguments().getBoolean(CORRECT);
		mWord = (WordWithTranslation) getArguments().getSerializable(WORD);
		if (getActivity() instanceof OnDismissListener) {
			mActivity = (OnDismissListener) getActivity();
		} else { 
			Log.d("tag", getActivity().getClass()
					+ " must implement OnDismissListener"); 
			dismiss();
		} 
	} 
 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
Contextual code suggestions in your IDE  Get Codota for Java