1.
Hello, I'm tring to put "refresh button" to my widget.
I've tried following code but It always make crash..
----------------------------------------
public void onReceive(Context context, Intent intent) {
if(intent.getAction().equals("com.onyoo.aStock.REFRESH"))
{
Write here your button click code
Toast.makeText(context, "Updating...",
Toast.LENGTH_SHORT).show();
final int[] appWidgetIds = intent.getExtras().getIntArray
(AppWidgetManager.EXTRA_APPWIDGET_IDS);
final int N = appWidgetIds.length;
for (int i=0; i<N; i++) {
super.onUpdate(context, AppWidgetManager.getInstance
(context), appWidgetIds);
updateAppWidget(context, AppWidgetManager.getInstance
(context), appWidgetIds[i]);
}
super.onReceive(context, intent);
}
----------------------------------------
2.
and I don't know why but somehow my widget doesn't update itself..
I set android:updatePeriodMillis to "1000" but still doesn't do update
Any help will be appreciated, thanks!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en