请提供Android错误消息说明

Dav*_*ave 0 android android-widget android-intent android-layout

有人可以解释下面的错误信息是什么意思吗?错误是:

java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.TextView
Run Code Online (Sandbox Code Playgroud)

nge*_*esh 5

你可能在做..

TextView text = (TextView)findViewById(R.id.image);
Run Code Online (Sandbox Code Playgroud)

其中view是图像按钮..

所以现在它无法将图像按钮转换为TextView ..将其更改为

ImageButton button= (ImageButton )findViewById(R.id.image);
Run Code Online (Sandbox Code Playgroud)