java - Start MainActivity when android kill my process -
when app inactive time android kills process, making static variables null. destroying activities etc. want app launch mainactivity(activity declared launcher in manifest) instead of activity in foreground when app got minimalized , later killed.
thanks in advance
the right way store data need (that storing on static vars) on database , use memory cache.
the not hammer time way it... simple. in each oncreate
of activities need info, check if info null, , if is, invoke finish()
, startactivity
1 want.
@override protected void oncreate(){ super.oncreate(); ... if(singleton.getinfo() == null){ this.finish(); startactivity(...) } }
Comments
Post a Comment