问题描述
我试图创建一个库项目,以将其用于Unity3d插件。一切都是正确的,但是当我试图显示自定义progressDialog比如我这样做,得到的资源$ NotFoundException
I'm trying to create a library project to use it for a Unity3d Plugin. All is correct but when i'm trying to show a custom progressDialog for example i'm doing this, getting Resources$NotFoundException
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(com.myapp.test.R.layout.loading, null);
layout.setMinimumWidth((int)(displayRectangle.width() * 0.9f));
layout.setMinimumHeight((int)(displayRectangle.height() * 0.9f));
progress.setView(layout);
我做错了什么?我的图书馆项目(JAR文件)似乎包含任何布局或资源......我已经把日食preferences是图书馆如此。
I'm doing something wrong? My Library project ( jar file ) seems that not contains any layouts or resources... I have put in preferences of eclipse Is Library true.
推荐答案
您不能打包资源转化为一个jar文件。建议你做一个库项目,并参阅你的Android项目相同。
You cannot package resources into a jar file. Suggest you make a library project and refer the same in your android project.
有关更多信息,请查看下
For more information check the link below
右键单击该项目,转到物业,选择Android的,选择的是库(打勾)。
Right click on the project, goto properties, choose android, choose Is Library (tick).
要在YOUT Android项目引用库项目
To refer a library project in yout android project
在你的Android项目,转到物业,选择Android的,单击添加,浏览并添加库项目点击右键。点击应用和确定。
Right click on your android project, goto properties, choose android, click add, browse and add the library project. Click apply and ok.
添加actionbaesherlock库项目的快照。请注意绿色的勾。
Snap shot of adding actionbaesherlock library project. Note the green tick.
清理并生成。
这篇关于Android的图书馆项目 - 资源$ NotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!