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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -