android.content.res.Resources$NotFoundException: String resource ID #0x2 Database

前端 未结 2 1782
半阙折子戏
半阙折子戏 2021-01-13 01:52

When I try to test my app, I get an error.

FATAL EXCEPTION: main Process: com.example.android.lab5, PID: 12261 android.content.res.Resources$NotFoun

相关标签:
2条回答
  • 2021-01-13 02:39
    lblMin.setText(jour.getmTempMin());
    lblMax.setText(jour.getmTempMax());
    

    You're calling setText(int) that expects a resource id. To use setText(CharSequence) instead, you can change the code to e.g.

    lblMin.setText(String.valueOf(jour.getmTempMin()));
    lblMax.setText(String.valueOf(jour.getmTempMax()));
    
    0 讨论(0)
  • 2021-01-13 02:42

    You need to use a String. This worked for me:

    lblMin.setText(Integer.toString(jour.getmTempMin()))
    
    0 讨论(0)
提交回复
热议问题