javascript - Store Data (High Score) in my app -
i developed clicker program when click on button strata counting clicks , after 15 seconds button goose disabled , want **how clicked in 15 seconds store high score , when cross high score store new high score show on same activity **
you can save , check high score using sharedpreferences. this:
these lines under set_contentview @ start:
string prefs_game ="your package name"; sharedpreferences sp = getsharedpreferences(prefs_game,context.mode_private); final integer oldrec = sp.getint("record",0);
then write code in setonclicklistenre:
if (newrec>oldrec){ sp.edit().putint("record",new rec).commit(); toast.maketext(mainactivity.this,"your new record :"+newrec, toast.length_short).show(); }
Comments
Post a Comment