开发者

Android resources in library not inherited by library consumer when running in Android1.5

I have a common library I use for apps of a similar type. The library has png files in the res/drawable-hdpi folder, as they are used by in all the other apps that use the library, so I don't have to keep copies in each application.

It seems that in Android 1.5, the drawable resources from the library are NOT inherited when the application imports the library, but does in all versions beyond Android 1.5. My application runs, and I immediately get a ResourceNotFoundException when an activity that uses the resource is loaded. Is there a way I can specify the resources as public or available in some way? I specified Activities in the library within the Android Manifest so they could be run by users of the library. Is there a way to do that with resources? Also, why is this only happening with Androi 1.5? Thanks?

04-21 21:33:07.268: ERROR/AndroidRuntime(786): Uncaught handler: thread main exiting due to uncaught exception
04-21 21:33:07.424: ERROR/AndroidRuntime(786): android.content.res.Resources$NotFoundException: Resource ID #0x7f020008
04-21 21:33:07.424: ERROR/AndroidRuntime(786):     at android.content.res.Resources.getValue(Resources.java:846)
04-21 21:33:07.424: ERROR/AndroidRuntime(786):     at android.content.res.Resources.getDrawable(Resources.java:534)
04-21 21:33:07.424: ERROR/AndroidRuntime(786):     at com.android.internal.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:432)
04-21 21:33:07.424: ERROR/AndroidRuntime(786):     at com.android.internal.view.menu.IconMenuItemView.initialize(IconMenuItemView.java:109)
04-21 21:33:07.424: ERROR/AndroidRuntime(786):     at com.android.internal.view.menu.MenuItemImpl.createItemView(MenuItemImpl.java:开发者_开发问答586)


Those folders like 'res/drawable-hdpi' where introduced first in Android 1.6. Android 1.5 only supports the 'res/drawable'-folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜