Android : setting text of text view in java -android

on Wednesday, October 29, 2014


So I don't get any compiler errors but when I press the button that calls the method the app crashes. I'm just trying set the text of the text view to the variable level.


Activity:



public void newGame(View view){
int level=1;
int XP=0;
TextView ltxt = (TextView) findViewById(R.id.trainLvl);
ltxt.setText(level);
}

0 comments:

Post a Comment