Code example for DialogFragment

Methods: onCreate, setRetainInstance

0
	} 
	 
	public class ProductPickerFragment extends DialogFragment{
		@Override 
		public void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			setRetainInstance(true);
		} 
		 
		public Dialog onCreateDialog(Bundle savedInstanceState) {
			AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
			builder.setTitle("Środki transportu");
			 
			for(int i = 0; i < 7; i++)
				dial[i] = p[i];
			 
			builder.setMultiChoiceItems(items, p, new OnMultiChoiceClickListener() {
				 
				@Override 
				public void onClick(DialogInterface arg0, int arg1, boolean arg2) {
					dial[arg1] = arg2;