Skip to content Skip to sidebar Skip to footer

Android Widget Won't Have A Click

Basically I've got this Widget, that's supposed to show a Toast once it is clicked. public class WidgetActivity extends AppWidgetProvider { @Override public void onUpdate(Conte

Solution 1:

I am here to save you.

1) onUpdate override should call (in the beginning of the method for example)

super.onUpdate(context, appWidgetManager, appWidgetIds);

2) Because of this line:

intent.setAction("ActionOne");

Your intents can be ignored, so the code wonT fall into the if in the onReceive. Add a unique identifier like it is done in this post Android keeps caching my intents Extras, how to declare a pending intent that keeps fresh extras?

On a last note, I d change my class name since it is not an Activity actually.

Cheers.

Post a Comment for "Android Widget Won't Have A Click"