Android: Service start Activity -


the problem is: service send me data every 1 hour , need start activity1. if nothing, time create same activity1 , in 5 hours in stack have 5 same activities...so, how kill activity before new 1 start ? !

            intent dialogintent = new intent(getbasecontext(), someclass.class);             getapplication().startactivity(dialogintent); 

so, how kill activity before new 1 start ?

you don't.

first, users attack hunting knives popping activity in middle of nowhere. not know may in middle of doing (playing game, typing text message, etc.). few apps, such voip clients , alarm clocks, should displaying activities except based upon direct user input.

second, don't "kill activity" service. rather put appropriate flags on intent bring existing activity front if exists (e.g., flag_reorder_to_front), rather create new one.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -