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):

http://developer.android.com/reference/android/content/intent.html#getintextra(java.lang.string, int)

int = getintent().getintextra("somename", 0); 

would job


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -