Wednesday 15 May 2013

alertdialog - Android: Check for first time launch -


I created a shared preference system that will check that the user launches the app for the first time If not, then this is a AlertDialog

  Create Options menu on the public button (menu menu) {// MenuFuller Menu Inflator Inflight = Millen Inflator () Will launch; Inflater.inflate (R. Menu menu, menu); Inflater.inflate (RM menu, menu); Shared context settings = references received ("prefaces", 0); Boolean prefix = settings. Get boolean ("prefix", true); If (first) {alterdialog. Builder Ads = New AlterDialog.Builder (this); Ad.setTitle ("Niveve Gibruker?"); Ad.setMessage ("- to leave you in this menu, and then click on the menu again. \ N - To refresh you in that menu, click on the page and refresh again. \ N - YouTube of the RosterVisioning via e-mail Delayed via WhatsApp. "); Ad.setNegativeButton ("OK", New DialogInterface.OnClickListener () {Click Public Zero (DialogInterface dialogue, int id) {dialog.dismiss ();}}); Ad.show (); } // return true return is true; }   

But I think I could not do it well, because it launches alerts every time it starts the apple . What did I do and how did I solve it?

your code

  .... bullion prefix = settings Get boolean ("prefix", true); If (firstRun) {settings.edit () PutBoolean ("firstRun", incorrect) .commit (); // Set your flag to false ....    

No comments:

Post a Comment