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

前端 未结 2 1784
半阙折子戏
半阙折子戏 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()));
    

提交回复
热议问题