when i execute the code shown below
int random = (int)Math.ceil(Math.random()*100);
Toast.makeText(getApplicationContext(), random, Toast.LENGTH_SHORT).show();
i get this log
E/AndroidRuntime( 994): java.lang.RuntimeException: Unable to start activity Co
mponentInfo{com.p/com.p.main}: android.content.res.Resources$NotFoundException:
String resource ID #0x4b
Could you please tell me what is the error?
Use this:
The Toast (or even TextViews) does not accept integers as input resources, you have to provide string resources.