xamarin - Return from background relaunches the entire app -


i have xamarin forms app, , want avoid scenario startup flow has ended, data loaded , displayed, , when app goes background , return, same screen before going background displayed instead of going on startup process again.

as far see, each time app returns background, mainactivity calls method oncreate, initiates startup process.

there bugs in xamarin.forms (i don't know if fixed). dirty hack is:

public class mainactivity : formsapplicationactivity     {         public override bool onkeydown(keycode keycode, keyevent e)         {             if (this.actionbar.title == "yourmainmenutitle")             {                 if (keycode == keycode.back && e.repeatcount == 0)                 {                     movetasktoback(true);                     return true;                 }             }              return base.onkeydown(keycode, e);         }          // ...     } 

more here: http://forums.xamarin.com/discussion/comment/89844


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -