android - How to pass an int between activities? -
i'm making android quiz , 1 activity stores every question. score displays on activity , if score goes new activity.. , displays..
code in quiz:
intent theintent = new intent(this, score.class); theintent.putextra("somename", score); startactivity(theintent);
code in score:
int = getintent().getintextra("somename");
i error on word.. "getintextra" above in score activity
getintextra() takes second parameter (default value in case can't found):
int = getintent().getintextra("somename", 0);
would job
Comments
Post a Comment