java - Force My Activity To Call The onSavedInstance State -
i have android application in utilize 2 themes. on theme alter need recreate activities , fragments within recreated.
the same way our application recreated using saved instnce state.
is there way can forcefulness activity phone call saved instance state ? if possible how can ? if not why ? there alternative accomplish ?
my current code looks below.
public static final void restartactivity(final fragmentactivity activity){ activity.finish(); activity.startactivity(new intent(activity, activity.getclass())); } the issue fragment stack not getting recreated. help appreciated.
your state not saved because you're creating new instance of activity. solution, can pass state new instance intent extras , restore state in oncreate extras.
java android android-activity
No comments:
Post a Comment