android.content.res.Resources$NotFoundException: String resource ID Fatal Exception in Main

前端 未结 6 1325
攒了一身酷
攒了一身酷 2020-12-05 01:15

I\'ve been trying to make a simple program that fetches a small random number and displays it to the user in a textview. After finally getting the random number to generate

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 01:57

    You are trying to set int value to TextView so you are getting this issue. To solve this try below one option

    option 1:

    tv.setText(no+"");
    

    Option2:

    tv.setText(String.valueOf(no));
    

提交回复
热议问题