android - How to open the previous instance of an Activity and recreate it -


if call activity activity_b , 1 of it's instances present in backstack, want go instance, removing activities in between, , recreate instance(to refresh content).

i tried:

intent intent = new intent(activity_a.this, activity_b.class); intent.addflags(intent.flag_activity_single_top); startactivity(intent); finish(); 

and in activity_b:

@override protected void onnewintent(intent intent) {     super.onnewintent(intent);     log.d("activity_b", "onnewintent");     //thought of refreshing content here. } 

i never found above actions.

the best found flag_activity_single_top not recreate activty, instead call onnewintent() can refresh content.

but every time new instance of activity_b called.

what missing?

thank you

try using flag_activity_reorder_to_front instead. bring running instance of activity front if exists.

once activity comes foreground, it's onresume() method called usual can refresh ui.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -