I am trying to execute a backport android 1.6+ application for android 1.5.
Following the guidelines here:
... I did the following:
- Change AndroidManifest.xml to set minSdkVersion to 3
- Move all my files that were previously in drawable-mdpi / to drawable /
- Rename drawable-hdpi / to drawable-hdpi-v4 /
It seems to me that this should ensure that 1.5 devices use files with the ability to draw / while 1.6 and later devices use files in drawable / and drawable-hdpi-v4 /, if necessary. The drawable / and drawable-hdpi-v4 / directories are the only directories available in my res folder.
However, after compiling, installing and running the resulting binary file on emulator 1.5, I get the following error:
E/AndroidRuntime( 1096): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 1096): at android.widget.ImageView.<init>(ImageView.java:103) E/AndroidRuntime( 1096): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 1096): at java.lang.reflect.Constructor.newInstance(Constructor.java:446) E/AndroidRuntime( 1096): at android.view.LayoutInflater.createView(LayoutInflater.java:499) E/AndroidRuntime( 1096): ... 26 more E/AndroidRuntime( 1096): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/bg.png from drawable resource ID
For reasons that I donβt understand, 1.5 devices cannot see the bg.png image file, a version of which is in the drawable / and drawable-hdpi-v4 / directories.
Running the same binaries works fine on 1.6.
Why won't it be visible that 1.5 devices display my res / drawable / bg.png image with this setting?
UPDATE: As described in Providing Screen Resource Compatibility for Android 1.5 , I use the Android SDK r6 and put my mdpi resources in the drawable / directory. In addition, I checked that the problem is not isolated from bg.png. If I remove the broken link selected in my xml, the application breaks into the next and each subsequent graphic during setContentView ().
emmby
source share