Answers for "android.content.res.Resources$NotFoundException: String resource ID"

3

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

(Just assumption, less info of Exception stacktrace)

I think, this line, incercari.setText(valIncercari); throws Exception because valIncercari is int

So it should be,

incercari.setText(valIncercari+"");
Or

incercari.setText(Integer.toString(valIncercari));
Posted by: Guest on March-05-2021
0

android.content.res.Resources$NotFoundException: String resource ID

List<int> list = {1 , 2 }
Toast.makeText(mainActivity , list.size() , Toast.LENGTH_SHORT).show();

Can not Toast int , it should be
Toast.makeText(mainActivity , String.valueOf(list.size()) , Toast.LENGTH_SHORT).show();
Posted by: Guest on September-04-2021

Code answers related to "android.content.res.Resources$NotFoundException: String resource ID"

Browse Popular Code Answers by Language