Code example for DialogFragment

Methods: onSaveInstanceState

0
			mMessage = savedInstanceState.getString("message");
	}	 
	 
	@Override 
	public void onSaveInstanceState(Bundle bundle) {
		super.onSaveInstanceState(bundle);
		bundle.putString("message", mMessage);
	} 
 
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		 
		ProgressDialog dialog = new ProgressDialog(getActivity());
		dialog.setIndeterminate(true);
		dialog.setTitle("Waiting...");
		dialog.setMessage(mMessage);
		dialog.setCancelable(false);
		return dialog;
	}; 
}//end of class 
Connect your IDE to all the code out there  Get Codota for Java