0

I am a newbie in Android development and I am faced with a problem which I can't figure out. I am following this link. It is a simple widget which has a listView which shows harcoded feed.

I wanted to make the widget interactive. So I came up with a solution as follows: I created a Intent, associated with it a Action and Broadcasted it with PendingIntent. Now I tried to catch that Intent in the onReceive() function of the WidgetProvider.java class.

I thought this approach is great except the fact that onUpdate function is called every 30 minutes. I am not sure even if it works after 30 minutes, haven't tried it. So I can't figure out how do I achieve this.

Basically I wanted to make it into widget, on which if clicked, it launches another activity. And can you also tell when is the onReceive function of the AppWidgetProvider called.

halfer
  • 19,824
  • 17
  • 99
  • 186
calche93
  • 105
  • 1
  • 7
  • Have you checked the following post? http://stackoverflow.com/questions/2748590/clickable-widgets-in-android?rq=1 – Ben Steele Jun 04 '14 at 14:00
  • @BenSteele: yes I have. Actually this was the post which gave me the idea of this technique. But sadly it didn't work. – calche93 Jun 04 '14 at 14:09
  • https://developer.android.com/guide/topics/appwidgets/index.html – Karakuri Jun 04 '14 at 14:43
  • You can also force an update by getting an `AppWidgetManager` and calling `updateAppWidget` with the app widget id. – Karakuri Jun 04 '14 at 14:44

0 Answers0