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

前端 未结 5 1003
醉梦人生
醉梦人生 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:41

    You use textview in xml, but in the activity you try to EditText t=(EditText) findViewById(R.id.t) - not correct; use TextView t=(TextView) findViewById(R.id.t);

    or change in xml TextView to EditText

提交回复
热议问题