Skip to content Skip to sidebar Skip to footer

Android: How Not To Save Instance State?

My app has login, once the access is granted, it creates a new html file to the sdcard, the output or the appearance of that html file depends on the account of the logger. After w

Solution 1:

Make sure that when user chooses the "login as different user" option, activity showing the HTML is finished (i.e. call the finish method on it). If you then ignore the savedInstanceState parameter in its onCreate event (which you likely do, I presume), the next time this activity is started it will be totally new instance of it.

Solution 2:

Try this and see if it works.

Intent nextActivity = newIntent(AppView.this, MyMainAct.class);
startActivity(nextActivity);
finish();

Post a Comment for "Android: How Not To Save Instance State?"