android - Activity finished after changing locale -


i have activity a , called activity b. in manifest activity has configchanges android:configchanges="locale|orientation|screensize".

in activity - changing locale

@override public void onconfigurationchanged(configuration newconfig) {     super.onconfigurationchanged(newconfig);     resources res = this.getresources();     res.updateconfiguration(newconfig, null);     intent intent = getintent();     intent.addflags(intent.flag_activity_no_animation);     intent.addflags(intent.flag_activity_reorder_to_front);     startactivity(intent); } 
  • for starting activity b

    intent intent = new intent(this, b.class); startactivity(intent);

if start activity , change locale working fine. if try start activity a, start activity b , after go activity , change locale, activity not restarted, destroyed. how can prevent activity being destroyed?

add flag intent.flag_activity_reorder_to_front intent. reorder existing activity stack if running.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -