Eyal T
- Forum posts: 2
Jan 5, 2012, 7:38:36 PM via Website
Jan 5, 2012 7:38:36 PM via Website
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>
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>
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.