开发者

Android 1.5 Menu Inflator didn't find Image

In Android 1.6 and higher, this menu XML inflates and runs fine. But when run in 1.5 I get an error about a resource not found.

I find that when I remove the 开发者_如何学Go@drawable/menu_preferences from the XML in 1.5 it works fine.

Is there a 1.5 work around I can do to get the image to work?

EDIT: The image is in the drawable-mdpi folder.

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item 
        android:id="@+id/menu_settings"
        android:title="@string/settings"
        android:icon="@drawable/menu_preferences" />
</menu>


As you might see If you read that, screen size support was introduced in Android 1.6. This might explain why you are getting this issue. This means that maybe the drawable-mdpi folder is not properly detected by the system 1.5. Try adding a "drawable" folder with nothing else behind it and put your image in it.


What does the eclipse completion says to you when you type "@drawable/men" ? Did you refresh your eclipse project after adding your image ? What is the image format?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜