I've got an int i
int i = 5;
then I convert it into String str
String str = Integer.toString(i);
then I try to set String str
to TextView tvEx
tvEx.setText(str);
And then my program break down. Can you help me?
ExActivity.java ----------
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (data == null) {return;}
Log.d(TAG, "1");
int i = data.getIntExtra("Days", days);
Log.d(TAG, "2");
String str = Integer.toString(i);
Log.d(TAG, "3");
tvD.setText(str);
Log.d(TAG, "4");
}
Logcat said -----------
D/Days﹕ 1
D/Days﹕ 2
D/Days﹕ 3
Virtual device -----------
Sorry, Days has stopped