安卓:资源不包含包的资源数量为0x [英] Android: Resources don't contain package for resource number 0x

查看:168
本文介绍了安卓:资源不包含包的资源数量为0x的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一篇android的自定义视图。它使用了一些巴的,在绘制文件夹我的项目(​​我把它放在现在所有的绘制文件夹,只是为了确保)提供的资源。

I'm writing on a custom view in android. It uses some png's, provided as resources in the drawable-folder (I put it in all of the drawable folders now, just to make sure) of my project.

不幸的是,当我启动应用程序,我得到一个强制关闭的最后一件事日志说的是:WARN /的ResourceType(261):资源不包含资源数量0x7f020002包 (十六进制号是第一个图标,我打算加载)。

Unfortunately, when I startup the app, I get a force close and the last thing the log says is: "WARN/ResourceType(261): Resources don't contain package for resource number 0x7f020002" (The Hex-Number is the first icon I intend to load).

现在的奇怪的事情:图形布局编辑器中的Eclipse ADT插件有没有任何问题加载显示在设计视图中的图标。只有当我开始了实际的应用程序(模拟器或实际的手机),即Android无法找到资源。

Now for the curious thing: The graphical layout-editor of the eclipse adt plugin has no problems whatsoever loading an displaying the icons in its design view. It's only when I start up the actual app (emulator or actual cellphone), that android can't find the resources.

我试图清理项目,并刷新文件结构。这并没有完全制定出-.-

I tried cleaning the project and refreshing the file structure. That didn't quite work out -.-

编辑:我只是意识到,我甚至无法加载字符串资源。这个问题似乎存在的所有资源。我必须做一些事情,以前的资源可用?

I just realized that I can't even load a string resource. The problem seems to exist for all resources. Do I have to do something, before the resources become available?

希望有人能帮助我,

THX预先

推荐答案

KK,今年的哑奖项去给我。我用 Resources.getSystem()。获取... 而不是 this.getContext()。getResources()获取...

kk, this year's dumbness awards go to me. I was using Resources.getSystem().get... instead of this.getContext().getResources().get...

THX各位的帮助

这篇关于安卓:资源不包含包的资源数量为0x的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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