1. Download our Official Android App: Forums for Android!

Apps onUpdate is never being called - any ideas?

Discussion in 'Android Development' started by eltn99, Jan 5, 2012.

  1. eltn99

    eltn99 Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    2
    Joined:
    Jan 5, 2012

    Jan 5, 2012
    2
    0
    25
    Hi all

    I try create a clickable widget.
    I saw that the clickable notification is not configured because onUpdate function is never being called (so I cannot set the notification)
    * I did not saw the log in the LogCat so I assume that the function is never being called
    * The Log in the onRecieve is being execute when I add the widget to the screen, and once in 30 minutes.


    Can anyone help me?

    Thanks Eyal


    public class AnimationWidget extends AppWidgetProvider {
    public static int imageNumber = 0;
    private static final String ACTION_WIDGET_RECEIVER = "ActionRecieverWidget";




    /** Called when the activity is first created. */



    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager,
    int[] appWidgetIds) {

    Log.i("print from main", "widget id: ");

    }

    @Override
    public void onReceive(Context context, Intent intent) {


    Log.i("print from main", "onReceive " + intent.getAction());
    }

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.animation.widget"
    android:versionCode="1"
    android:versionName="1.0">
    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7"/>

    <!-- Broadcast Receiver that will process AppWidget updates -->
    <application android:icon="@drawable/pic" android:label="@string/app_name">
    <receiver android:name=".AnimationWidget" android:label="@string/app_name">
    <intent-filter>
    <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
    </intent-filter>
    <meta-data android:name="android.appwidget.provider"
    android:resource="@xml/widget_info" />
    </receiver>
    <service android:name=".AnimationWidget$UpdateService" />



    </application>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    </manifest>
     

    Advertisement

Share This Page

Loading...