[英]reference to findViewById is ambiguous
I tell you a few days ago that I could not debug my application, then I reinstalled the android studio and updated the latest version, now that I want to continue with my project in each of the activities where I use "findViewById (R.id.nombre )"
the following error appears: 我几天前告诉您,我无法调试应用程序,然后我重新安装了android studio并更新了最新版本,现在我想在使用
"findViewById (R.id.nombre )"
,则会出现以下错误:
Error: (23, 31) error: reference to findViewById is ambiguous
both method findViewById (int) in Activity and method <T> findViewById (int) in AppCompatActivity match
where T is a type-variable:
T extends View declared in method <T> findViewById (int)
I have already searched here, but my problem is still I hope you can help me, I attach some captures 我已经在这里搜索过,但是我的问题仍然是我希望您能为我提供帮助,并附上一些照片
You're using findViewById (R.id.nombre )
. 您正在使用
findViewById (R.id.nombre )
。 Where nombre is defined in two activities(Activity and AppCompatActivity) with same name. 其中在两个活动(Activity和AppCompatActivity)中使用相同的名称定义了nombre。 You should assign different name for nombre in each activity.
您应在每个活动中为nombre指定不同的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.