布局及其元素无法添加到任何活动中

时间:2022-10-14 05:26:32

I develop support classes for my application in another project, and later, I add it to my app. I have made a class that shows a dialog, and works perfectly in its project, but when I add it to my app's project doesn't recognize the layout and its elements.

我在另一个项目中为我的应用程序开发支持类,之后,我将它添加到我的应用程序中。我创建了一个显示对话框的类,并且在其项目中完美运行,但是当我将它添加到我的应用程序时,项目无法识别布局及其元素。

布局及其元素无法添加到任何活动中

I'm sure all are added, but seem like any haven't reference in the R xml. Do you know any solution? Thanks a lot!

我确定所有内容都已添加,但似乎在R xml中没有引用。你知道任何解决方案吗?非常感谢!

2 个解决方案

#1


1  

You need to add the Reference/Library Project in the Build Path of your Running application then only you can use elements and layouts of that Reference/Library Project into your Running application.

您需要在Running应用程序的Build Path中添加Reference / Library Project,然后才能将该Reference / Library Project的元素和布局用于Running应用程序。

Hope it helps you.

希望它能帮到你。

Thanks.

谢谢。

#2


0  

check if in your imports you are importing your.package.R instead of android.R, it is a common issue

检查你的导入是否导入your.package.R而不是android.R,这是一个常见的问题

#1


1  

You need to add the Reference/Library Project in the Build Path of your Running application then only you can use elements and layouts of that Reference/Library Project into your Running application.

您需要在Running应用程序的Build Path中添加Reference / Library Project,然后才能将该Reference / Library Project的元素和布局用于Running应用程序。

Hope it helps you.

希望它能帮到你。

Thanks.

谢谢。

#2


0  

check if in your imports you are importing your.package.R instead of android.R, it is a common issue

检查你的导入是否导入your.package.R而不是android.R,这是一个常见的问题