Tasks/src/main/java/com/dummies/tasks/fragment/TaskEditFragment.java
@Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);

        // These two fields may have changed while our activity was
        // running, so make sure we save them to our outState bundle so
        // we can restore them later in onCreate.
        outState.putLong(TASK_ID, taskId);
        outState.putSerializable(TASK_DATE_AND_TIME, taskDateAndTime);
    }
/**
     * Android Activities can be killed at any time to save memory.  If
     * the user returns to the activity, it may be re-created again.
     * When it's killed, the Android OS will automatically
     * save the current state of any views (such as EditTexts) that the
     * user may have changed into the outState Bundle.  When it's
     * re-created, those values will be automatically set for you in
     * onCreate from the savedInstanceState bundle.
     *
     * However, while Android can do that for views for you
     * automatically, Android cannot do that for non-views.  So any
     * time you have any state that you or the user may modify in your
     * fragments or activities, it's UP TO YOU to make sure you save
     * them properly!  To do this, just save the value to the outState
     * bundle, and then read it back in again from the
     * savedInstanceState bundle in onCreate.
     *
     * DO NOT FORGET TO DO THIS!
     *
     * If you forget, your app will appear to work fine.  You won't
     * immediately notice anything wrong.  But anytime you rotate your
     * phone, or leave an app running for awhile in the background and
     * then later return to it, you may experience random crashes and
     * unexpected behavior.
     */
Android Activities can be killed at any time to save memory.  If
the user returns to the activity, it may be re-created again.
When it's killed, the Android OS will automatically
save the current state of any views (such as EditTexts) that the
user may have changed into the outState Bundle.  When it's
re-created, those values will be automatically set for you in
onCreate from the savedInstanceState bundle.

However, while Android can do that for views for you
automatically, Android cannot do that for non-views.  So any
time you have any state that you or the user may modify in your
fragments or activities, it's UP TO YOU to make sure you save
them properly.  To do this, just save the value to the outState
bundle, and then read it back in again from the
savedInstanceState bundle in onCreate.

DO NOT FORGET TO DO THIS!

If you forget, your app will appear to work fine.  You won't
immediately notice anything wrong.  But anytime you rotate your
phone, or leave an app running for awhile in the background and
then later return to it, you may experience random crashes and
unexpected behavior.
Android Activities can be killed at any time to save memory . If the user returns to the activity it may be re - created again . When it ' s killed the Android OS will automatically save the current state of any views ( such as EditTexts ) that the user may have changed into the outState Bundle . When it ' s re - created those values will be automatically set for you in onCreate from the savedInstanceState bundle . However while Android can do that for views for you automatically Android cannot do that for non - views . So any time you have any state that you or the user may modify in your fragments or activities it ' s UP TO YOU to make sure you save them properly . To do this just save the value to the outState bundle and then read it back in again from the savedInstanceState bundle in onCreate . DO NOT FORGET TO DO THIS! If you forget your app will appear to work fine . You won ' t immediately notice anything wrong . But anytime you rotate your phone or leave an app running for awhile in the background and then later return to it you may experience random crashes and unexpected behavior .
@Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putLong(TASK_ID, taskId);
        outState.putSerializable(TASK_DATE_AND_TIME, taskDateAndTime);
    }
@ Override public void onSaveInstanceState ( Bundle outState ) { super . onSaveInstanceState ( outState ) ; outState . putLong ( TASK_ID , taskId ) ; outState . putSerializable ( TASK_DATE_AND_TIME , taskDateAndTime ) ; }
Android Activities can be killed at any time to save memory.
Android Activities can be killed at any time to save memory .
// These two fields may have changed while our activity was // running, so make sure we save them to our outState bundle so // we can restore them later in onCreate.