java - Update score android sdk -


i have problem code,

i update score positiv , negative score no update. thank help.

int score = 5;   if(v == findviewbyid(r.id.bottomlinear)) {      view view = (view) event.getlocalstate();      viewgroup viewgroup = (viewgroup) view.getparent();      viewgroup.removeview(view);       //change text      string scr = string.valueof(score++);      textview score1 = (textview) findviewbyid(r.id.score);      score1.settext(scr); } else if(v == findviewbyid(r.id.bottomlinear2)) {      view view = (view) event.getlocalstate();      viewgroup viewgroup = (viewgroup) view.getparent();      viewgroup.removeview(view);       //change text      string scr = string.valueof(score--);      textview score2 = (textview) findviewbyid(r.id.score);      score2.settext(scr); } 

try set variable , set score

int x = score++; textview score1 = (textview) findviewbyid(r.id.score); score1.settext(integer.tostring(score)); 

if still not work - you're sure, code going if or else?

another thing - (i'm not sure views) should use in 'if' method "equals" instead of '=='


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -