Why exactly is onFreeze () used?

In one Android tutorial, I saw the use of this feature. There he uses it to resume a previous application session, I think, but the problem is that I can not use this function in my class, and both classes (mine and him) extend to ListActivity.

@Override
    protected void onFreeze(Bundle outState) {
        super.onFreeze(outState);
        outState.putLong("feed_id", feed.feedId);
        outState.putString("title", feed.title);
        outState.putString("url", feed.url.toString());
    }

Also, I had some problem with some function calls before, for example, to control ArrayLists, it calls list.next (), and I don't have such a function, so I used list.MoveToNext (). Maybe this is due to another version of Android (I am using 1.6) and what should I use as a replacement for this function?

+3
source share
2 answers

, , . onFreeze() . ( 2008 .) - Android 0.9 SDK:

onFreeze (Bundle), onSaveInstanceState (Bundle), ,

+6

,

@Override 

onSaveInstanceState(Bundle outState)

{

//TODO auto generated block

super.onSaveInstanceState(outState);

}
+1

Source: https://habr.com/ru/post/1755271/


All Articles