onnewintent - Logging out from an android app -


i have app many activities, (the main), b, c, d, e , service running in background... app client connected server. @ point server tells client log out, service receives message , should logout , close app. tried start activity service , overriding in onnewintent callback never fired. problem i'd way kill app whatever activity i'm in. thought starting fresh activity (with clear_top) , overriding onneintent have been method never called. should use broadcast , receiver in each activity? correct pattern handle situation?

service when receives message:

intent intent = new intent(this, homepage.class); bundle b = new bundle(); b.putboolean("vimsandroid_sloggautente", true); intent.putextras(b); intent.setflags(intent.flag_activity_clear_top); startactivity(intent); 

a (the main):

@override public void onnewintent(intent i) {     finish(); startactivity(i); } 

thanks!!!

calling finish() kills particular activity in called. if want kill app try one.

system.runfinalizersonexit(true); //depricated now

or

android.os.process.killprocess(android.os.process.mypid());


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -