In my application I have recenlty added a home screen widget. Everything works fine except when trying to add a widget for the first time. Instead of opening the config Activity an ANR appears.
I'm guessing that since it works just fine after the first crash, the crash is probably caused by some undefined value. Or perhaps I have not understood the flow of things regarding an appWidget.
My Receiver is declared in the manifest with meta-data which points to the Activity used for preferences. This Activity consist of a spinner and a button. When the button is pressed an 'empty' RemoteView is passed to the host and a broadcast is sent to my service which will try to load data from a server. Do i need to pass a RemoteView to the host before user interaction?
The log entry makes no sense to me. I'm hoping that someone has a better understanding of log output than me:
I/ActivityManager( 51): Displayed activity com.android.settings/.AppWidgetPickActivity: 1086 ms (total 21908 ms)
E/my-appWidgetProvider( 228): BroadcastReciever enabled
D/AndroidRuntime( 228): Shutting down VM
W/dalvikvm( 228): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)
I/ActivityManager( 51): Starting activity: Intent { act=android.appwidget.action.APPWIDGET_CONFIGURE cmp=se.oskarnordgren.debaser/.widget.WidgetPrefs (has extras) }
W/InputManagerService( 51): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43922578
W/WindowManager( 51): Attempted to add window with non-application token WindowToken{43890b08 token=null}. Aborting.
D/dalvikvm( 228): DestroyJavaVM waiting for non-daemon threads to exit
W/ActivityManager( 51): Timeout of broadcast BroadcastRecord{438c3308 android.appwidget.action.APPWIDGET_UPDATE} - receiver=android.os.BinderProxy@4393cfe8
W/ActivityManager( 51): Receiver during timeout: ResolveInfo{438c3288 se.oskarnordgren.debaser.widget.DebaserWidget p=0 o=0 m=0x0}
I/ActivityManager( 51): ANR in process: se.oskarnordgren.debaser
I/ActivityManager( 51): Annotation: Broadcast of Intent { act=android.appwidget.action.APPWIDGET_UPDATE cmp=se.oskarnordgren.debaser/.widget.DebaserWidget (has extras) }
I/ActivityManager( 51): CPU usage:
I/ActivityManager( 51): Load: 0.87 / 0.36 / 0.13
I/ActivityManager( 51): CPU usage from 10094ms to 20ms ago:
I/ActivityManager( 51): com.android.settings: 6% = 3% user + 2% kernel / faults: 4014 minor 5 major
I/ActivityManager( 51): system_server: 3% = 2% user + 1% kernel / faults: 12 minor
I/ActivityManager( 51): logcat: 2% = 0% user + 1% kernel / faults: 108 minor
I/ActivityManager( 51): android.process.acore: 0% = 0% user + 0% kernel / faults: 2 minor
I/ActivityManager( 51): se.oskarnordgren.debaser: 0% = 0% user + 0% kernel / faults: 11 minor
I/ActivityManager( 51): com.android.phone: 0% = 0% user + 0% kernel / faults: 2 minor
I/ActivityManager( 51): adbd: 0% = 0% user + 0% kernel
I/ActivityManager( 51): sh: 0% = 0% user + 0% kernel / faults: 98 minor
I/ActivityManager( 51): TOTAL: 5% = 3% user + 1% kernel
I/ActivityManager( 51): Removing old ANR trace file from /data/anr/traces.txt
I/Process ( 51): Sending signal. PID: 228 SIG: 3
I/dalvikvm( 228): threadid=7: reacting to signal 3
I/dalvikvm( 228): Wrote stack trace to '/data/anr/traces.txt'
Why do I get an ANR instead of the Activity referenced in android:configure
?
I could paste more code if only I knew which parts are important here.