java.lang.ClassCastException:android.widget.TextView不能转换为android.widget.EditView [英] java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditView

查看:701
本文介绍了java.lang.ClassCastException:android.widget.TextView不能转换为android.widget.EditView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到的称号错误,当我跑我的应用程序,我已经检查了论坛,但我所有的编辑,文本视图被关闭。我真的不知道是什么问题,一切看起来没什么问题。

I get the error in the title when i run my application, I have checked the forums but all my Edit, text views are closed. I dont really understand what the problem is, everything looks fine to me.

<EditText
     android:id="@+id/fairgroundName"/>
 <EditText
     android:id="@+id/rideName"/>


ride =(EditText)findViewById(R.id.rideName);
fairground =(EditText)findViewById(R.id.fairgroundName);

但我不明白的问题是什么。谁能帮助,请

But I don't get what the problem is. Can anyone help please

推荐答案

您code看起来好像没什么问题了。貌似code为您的EditText未在 R.java

Your code looks fine to me too. Looks like the code for your EditText was not generated properly in R.java.

清除项目。我们希望,这将消除错误。

Clean the project. Hopefully, it would remove the error.

项目 - >清除

别忘了你尝试再次运行它之前卸载从手机应用程序。

Don't forget to uninstall the application from the phone before you try running it again.

这篇关于java.lang.ClassCastException:android.widget.TextView不能转换为android.widget.EditView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆