java.lang.ClassCastException: android.widget.TextView cannot be cast

前端 未结 5 1013
醉梦人生
醉梦人生 2020-12-30 13:08
12-01 00:36:28.058: E/AndroidRuntime(5062): Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText
5条回答
  •  灰色年华
    2020-12-30 13:29

     
    
    
    EditText t=(EditText) findViewById(R.id.t);
    EditText d=(EditText) findViewById(R.id.des);
    

    Do you want TextViews or EditTexts?

    Either change the XML to use EditTexts or the Java to use TextViews...

提交回复
热议问题