Code example for DialogFragment

Methods: onCreate, setRetainInstance

0
        void onReleaseSelected(String mbid);
    } 
     
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);
    } 
     
    @Override 
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        try { 
            callbacks = (ReleaseSelectionCallbacks) activity;
        } catch (ClassCastException e) {
            throw new ClassCastException(activity.toString() + " must implement "
                    + ReleaseSelectionCallbacks.class.getSimpleName());
        } 
    } 
     
    @Override