Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid appwidget crashes process com.android.settings on android v2.1, need work around
    primarykey
    data
    text
    <p>I'm working on an android appwidget and it works fine in all android versions I tried (emulator 1.5, 1.6, 2.3), but not 2.1 (physical device, LG GT540 upgraded to 2.1). I tested it on a Samsung GT I5801 fresh out of the box with the 2.1 OS and it worked, probably because tat particular revision the 2.1 version is older (or else Samsung themselves added the fix).</p> <p>By the way, this I think is the fix to the exact bug I am referring to:<br> <a href="https://android.googlesource.com/platform/packages/apps/Settings/+/7be5137e12ba58cebae634f640379599acdb491a" rel="nofollow noreferrer">https://android.googlesource.com/platform/packages/apps/Settings/+/7be5137e12ba58cebae634f640379599acdb491a</a></p> <p>And this is an older thread discussing the same problem: <a href="https://stackoverflow.com/questions/1573966/androidnpe-while-trying-to-activityforresult-with-action-appwidget-pick-intent">Android:NPE while trying to activityForResult with ACTION_APPWIDGET_PICK intent</a></p> <p>When I try to load the widget on the homescreen (actually it happens when I click the "Widgets" button) I get the following error:</p> <blockquote> <p>The application Settings (process com.android.settings) has stopped unexpectedly. Please try again.</p> </blockquote> <p>With a "Force close" button.</p> <p>See logcat output below. By the way this does not happen when my appwidget is not installed yet and it happens also on a 2.1 emulator.</p> <p>I have searched everywhere and there are lots of people mentioning this. Developers, but mostly users, and the general conclusion is that it is a bug in the android 2.1 OS. For example even google's own maps appwidget causes this crash.</p> <p>Now I know that there are appwidgets that work fine on 2.1. So there must be a work around. I just don't know what. I have read suggestions on here (sorry I can't find the link right now) that the appwidget needs more than one widget to get it to work. Mine now actually has 2 textviews, but I also tried with one textview and an image button. Neither works.</p> <p>I could of course avoid 2.1, but I rather would like this appwidget to work on as many android versions as possible (and I can't upgrade my GT540 as of yet), besides I am not willing to accept defeat. :-)</p> <p>Logcat stacktrace:</p> <pre><code>I/ActivityManager( 58): Starting activity: Intent { act=android.appwidget.action.APPWIDGET_PICK cmp=com.android.settings/.AppWidgetPickActivity (has extras) } W/InputManagerService( 58): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44d5d458 D/AndroidRuntime( 229): Shutting down VM W/dalvikvm( 229): threadid=3: thread exiting with uncaught exception (group=0x4001b188) E/AndroidRuntime( 229): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 229): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.AppWidgetPickActivity}: java.lang.NullPointerException E/AndroidRuntime( 229): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) E/AndroidRuntime( 229): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) E/AndroidRuntime( 229): at android.app.ActivityThread.access$2200(ActivityThread.java:119) E/AndroidRuntime( 229): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) E/AndroidRuntime( 229): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 229): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 229): at android.app.ActivityThread.main(ActivityThread.java:4363) E/AndroidRuntime( 229): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 229): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 229): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime( 229): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) E/AndroidRuntime( 229): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 229): Caused by: java.lang.NullPointerException E/AndroidRuntime( 229): at com.android.settings.ActivityPicker$IconResizer.createIconThumbnail(ActivityPicker.java:364) E/AndroidRuntime( 229): at com.android.settings.ActivityPicker$PickAdapter$Item.&lt;init&gt;(ActivityPicker.java:226) E/AndroidRuntime( 229): at com.android.settings.AppWidgetPickActivity.putAppWidgetItems(AppWidgetPickActivity.java:185) E/AndroidRuntime( 229): at com.android.settings.AppWidgetPickActivity.putInstalledAppWidgets(AppWidgetPickActivity.java:226) E/AndroidRuntime( 229): at com.android.settings.AppWidgetPickActivity.getItems(AppWidgetPickActivity.java:207) E/AndroidRuntime( 229): at com.android.settings.ActivityPicker.onCreate(ActivityPicker.java:98) E/AndroidRuntime( 229): at com.android.settings.AppWidgetPickActivity.onCreate(AppWidgetPickActivity.java:63) E/AndroidRuntime( 229): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) E/AndroidRuntime( 229): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) E/AndroidRuntime( 229): ... 11 more I/Process ( 58): Sending signal. PID: 229 SIG: 3 I/dalvikvm( 229): threadid=7: reacting to signal 3 I/dalvikvm( 229): Wrote stack trace to '/data/anr/traces.txt' E/ActivityThread( 58): Failed to find provider info for android.server.checkin E/Checkin ( 58): Error reporting crash: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/crashes W/ActivityManager( 58): Activity idle timeout for HistoryRecord{44c1fd30 com.android.settings/.AppWidgetPickActivity} </code></pre> <p>Manifest:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.example.exampleapp" android:versionCode="1" android:versionName="1.0" android:debuggable="true"&gt; &lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt; &lt;application android:label="exampleapp"&gt; &lt;receiver android:name="ExampleWidgetProvider" &gt; &lt;intent-filter&gt; &lt;action android:name="android.appwidget.action.APPWIDGET_UPDATE" /&gt; &lt;/intent-filter&gt; &lt;meta-data android:name="android.appwidget.provider" android:resource="@xml/example_appwidget_info" /&gt; &lt;/receiver&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion="3" /&gt; &lt;/manifest&gt; </code></pre>
    singulars
    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.
 

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