Waiting for the expected intention will not work after the application is suspended or killed

I have a widget that is part of my main application. Typically, when an application is updated, a PendingIntent is created, which causes the user to become active in the main application when the widget is clicked. However, when the main application is the forced termination or destruction of the OS due to an error, the widget stops responding when pressed. I believe that it also stops receiving translations because the onReceive method is not called.

Here is what I have in the manifest:

<receiver android:name=".widgets.AppWidget" android:label="@string/widget_name"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/> <action android:name="com.myApp.android.widgets.CLICK.start"></action> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/appWidget_provider"/> </receiver> 

The widget code is in a separate package from the main application.

+4
source share
1 answer

However, when the main application is the forced termination or destruction of the OS due to an error, the widget stops responding when pressed. I believe that it also stops receiving translations because the onReceive method is not called.

In Android 3.1+, the application widget will certainly stop working if the user closes you until the user starts one of your actions in other ways (for example, the start screen).

However, a β€œkilled OS due to an error" should not have this AFAIK effect. If you can create a reproducible test case demonstrating this, post it somewhere so we can study it.

+4
source

All Articles