Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old January 5th, 2012, 01:38 PM   #1 (permalink)
New Member
 
Join Date: Jan 2012
Posts: 2
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default onUpdate is never being called - any ideas?

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


publicclass AnimationWidget extends AppWidgetProvider {
publicstaticintimageNumber = 0;
privatestaticfinal String ACTION_WIDGET_RECEIVER = "ActionRecieverWidget";




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



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

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

}

@Override
publicvoid 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>

eltn99 is offline  
Reply With Quote
Sponsors
Reply

Bookmarks

Tags
onupdate widget


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:21 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo