android - Replace the normal intent with pending -


there activity started by:

intent = new intent(checkoutactivity.this, livestatusactivity.class); startactivity(intent); finish(); 

livestatusactivity newest activity, started checkoutactivity. lets livestatusactivity lies on top of activity stack.

at same time, starting pending intent on notification received,

intent in = new intent(this, livestatusactivity.class); in.setflags(intent.flag_activity_reorder_to_front); contentintent = pendingintent.getactivity(this, 0, in, pendingintent.flag_update_current); 

on pending intent activity, previous livestatusactivity started activity should updated/replaced.

right now, livestatusactivity started(by pending intent) , same activity still there on of it.

ie. livestatusactivity(top t by pending intent)-----> livestatusactivity(t-1 by checkoutactivity)---->.....

tried various flags, checked lot of answer @ s.o, in vain. tried putting android:launchmode="singletask", same result.

  make livestatusactivity android:launchmode="singletask" in manifest.xml     , in livestatusactivity override onnewintent(intent intent) method   when called second time onnewintent() called , inisde can update activity. 

remove flag in.setflags(intent.flag_activity_reorder_to_front);


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -