Code example for DialogFragment

Methods: getActivity, onCancel

0
	 * Force return to previous page (file explorer) when dialog closed 
	 * @see android.support.v4.app.DialogFragment#onCancel(android.content.DialogInterface) 
	 */ 
	@Override 
	public void onCancel(DialogInterface dialog){
		super.onCancel(dialog);
		getActivity().finish();
	} 
 
}