Note that there are some explanatory texts on larger screens.

plurals
  1. PODecoupled AppWidget Intents after Home process restart
    primarykey
    data
    text
    <p>My Android app Transdroid offers several home screen widgets. Every AppWidget has 2 'buttons' (ImageButton), one starts the app and one starts some activity that refreshes the AppWidget content. Pretty simple. <a href="http://www.transdroid.org/wp-content/uploads/2009/04/transdroid-screenshot-0.13.1-widget.png" rel="nofollow noreferrer">Here</a> is a screenshot. The widget code is at my Google Code website, but most importantly:</p> <pre><code>RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.appwidget_15); views.setOnClickPendingIntent(R.id.widget_action, PendingIntent.getActivity(context, 0, new Intent(context, Transdroid.class), 0)); appWidgetManager.updateAppWidget(id, views); </code></pre> <p>The problem is: the widget's onUpdate is not called after the Home process is restarted, and hence the PendingIntents used to attach functionality to the buttons is lost.</p> <p>It's fairly easy to reproduce.</p> <ol> <li>Start an emulator</li> <li>Add a widget (that uses a PendingIntent to, say, start an activity)</li> <li>Click the button to see it actually works</li> <li>Force kill the home proces ('adb -e shell kill 96' where 96 is the PID of android.process.acore)</li> <li>The widget's button doesn't work any more.</li> </ol> <p>More precise: no onReceive and thus no onUpdate is called when the android.process.acore Home process is restarted. In turn, no Intent is attached.</p> <p>Anyone experienced the same problem and knows how to circumvent this problem?</p>
    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