My application got crashed because of not initializing the view

后端 未结 3 363
孤独总比滥情好
孤独总比滥情好 2021-01-29 15:07

Here, i am trying to call setText method but my application is getting crashed because of some initialization problem.

EditText edittext;
    SharedPreferences          


        
3条回答
  •  暖寄归人
    2021-01-29 15:55

    its a very common mistake .. I should initialize the editText before calling a method on it by

    edittext =(EditText)findViewById(R.id.edit_message);

提交回复
热议问题