android.content.res.Resources$NotFoundException

前端 未结 2 897
栀梦
栀梦 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:41

    This line should be inside onClick() or compareID():

    userInput = input.getText().toString();
    
    0 讨论(0)
  • 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();
    
    0 讨论(0)
提交回复
热议问题