Note that there are some explanatory texts on larger screens.

plurals
  1. POAppWidgetProvider, onUpdate gets called several times on start
    primarykey
    data
    text
    <p>I have a problem regarding <code>AppWidgetProvider</code>. When the phone starts up the <code>onUpdate()</code> method for the <code>AppWidgetProvider</code> gets called four times in a row, all containing the same <code>appWidgetId</code>. I can't figure out why it's happening. Does anyone have a clue?</p> <p>I got two types of <code>super classes</code>, <code>Main</code> and <code>MainScroll</code>, and <code>four classes(widgets)</code> that extends the <code>super classes</code>. </p> <p><strong>Example widget</strong></p> <pre><code>public class WidgetMedium extends Main { public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); } } </code></pre> <p>The manifest</p> <pre><code> &lt;receiver android:name=".activity.Main"&gt; &lt;intent-filter&gt; &lt;action android:name="android.appwidget.action.APPWIDGET_UPDATE" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; &lt;receiver android:name=".activity.MainScroll"&gt; &lt;intent-filter&gt; &lt;action android:name="android.appwidget.action.APPWIDGET_UPDATE" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; &lt;receiver android:name=".activity.WidgetMedium" android:label="Swedroid Widget 4x3" android:icon="@drawable/widget_application"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&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/widget_provider_medium" /&gt; &lt;/receiver&gt; &lt;receiver android:name=".activity.WidgetScrollMedium" android:label="Swedroid Widget 4x3 Scroll" android:icon="@drawable/widget_application"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&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/widget_scroll_provider_medium" /&gt; &lt;/receiver&gt; &lt;receiver android:name=".activity.WidgetLarge" android:label="Swedroid Widget 4x4" android:icon="@drawable/widget_application"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&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/widget_provider" /&gt; &lt;/receiver&gt; &lt;receiver android:name="com.swedroid.widget.activity.WidgetScrollLarge" android:label="Swedroid Widget 4x4 Scroll" android:icon="@drawable/widget_application"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&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/widget_scroll_provider_large" /&gt; &lt;/receiver&gt; </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