Note that there are some explanatory texts on larger screens.

plurals
  1. POResourcesNotFoundException when initialising Drawable
    primarykey
    data
    text
    <pre><code>private Drawable drawable; drawable = this.getResources().getDrawable(R.drawable.icon); </code></pre> <p>When I run this on my htc desire it goes, but on emulator it crashes when I try to initialiser drawable. Why is this?</p> <p>edit: here is my stacktrace</p> <pre><code> 03-28 13:27:58.453: ERROR/ActivityThread(888): Failed to find provider info for com.google.settings 03-28 13:28:06.414: ERROR/AndroidRuntime(888): Uncaught handler: thread main exiting due to uncaught exception 03-28 13:28:06.486: ERROR/AndroidRuntime(888): java.lang.RuntimeException: Unable to start activity ComponentInfo{be.test.helloworld/be.test.helloworld.MyMapActivityII}: android.content.res.Resources$NotFoundException: Resource ID #0x7f020000 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.app.ActivityThread.access$1800(ActivityThread.java:112) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.os.Handler.dispatchMessage(Handler.java:99) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.os.Looper.loop(Looper.java:123) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.app.ActivityThread.main(ActivityThread.java:3948) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at java.lang.reflect.Method.invokeNative(Native Method) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at java.lang.reflect.Method.invoke(Method.java:521) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at dalvik.system.NativeStart.main(Native Method) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f020000 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.content.res.Resources.getValue(Resources.java:846) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.content.res.Resources.getDrawable(Resources.java:534) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at be.test.helloworld.MyMapActivityII.initOverlays(MyMapActivityII.java:44) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at be.test.helloworld.MyMapActivityII.onCreate(MyMapActivityII.java:38) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231) 03-28 13:28:06.486: ERROR/AndroidRuntime(888): ... 11 more </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload