android.content.res.Resources$NotFoundException

前端 未结 2 915
栀梦
栀梦 2020-11-27 08:26
@Override
public void onCreate(Bundle savedInstanceState){

    super.onCreate(savedInstanceState);
    setContentView(R.layout.screenlocked);

    //Retrieve stored         


        
2条回答
  •  再見小時候
    2020-11-27 08:54

    Here is your mistake:

    Toast.makeText(ScreenLockActivity.this, count, Toast.LENGTH_SHORT).show();
    

    the makeText you are trying to invoke here, is the makeText that takes as second parameter a resId. See here for more info. Since you want to print the count value, you have to convert it in a String.

    String value = String.valueOf(count);
    Toast.makeText(ScreenLockActivity.this, value, Toast.LENGTH_SHORT).show();
    

提交回复
热议问题