[android-developers] Re: Update widget from code

2009-06-29 Thread Aaron
anyone? On Jun 28, 6:05 pm, Aaron arro...@gmail.com wrote: Is there a way to push anupdateto awidgetfrom another activity? It seems like in order to use the AppWidgetManager.updateAppWidget method, it has to be within thewidgetcode itself?  Can i push anupdateto thewidgetfrom the app

[android-developers] Re: Update widget from code

2009-06-29 Thread Teo
I too am interested in this... On Mon, Jun 29, 2009 at 11:27 AM, Aaron arro...@gmail.com wrote: anyone? On Jun 28, 6:05 pm, Aaron arro...@gmail.com wrote: Is there a way to push anupdateto awidgetfrom another activity? It seems like in order to use the AppWidgetManager.updateAppWidget

[android-developers] Re: Update widget from code

2009-06-29 Thread Saurav Mukherjee
a simple solution is to have a local sqlite db to access from both the apps... if u r using intents to start 1 app from another, then u can bundle the data via intents! hope this helps. cheers! On Mon, Jun 29, 2009 at 1:57 PM, Aaron arro...@gmail.com wrote: anyone? On Jun 28, 6:05 pm,

[android-developers] Re: Update widget from code

2009-06-29 Thread Blake B.
I believe only the same application can push updates to a widget. I know I wouldn't want other apps to be able to send updates to my widget directly. The proper approach would be to handle it with your AppWidgetProvider subclass (remember this is simply a BroadcastReceiver with some help for

[android-developers] Re: Update widget from code

2009-06-08 Thread Teo
I've got a related question (or i'm not getting this right). The way i see it, onReceive can be used to handle interface events, but what pending intent do i need to attach to a button so that onReceive can be triggered? Thanks, Teo On Apr 23, 1:05 am, Al alcapw...@googlemail.com wrote: That

[android-developers] Re: Update widget from code

2009-05-08 Thread Carlos
Thank you very much, it runs good. Charles On May 7, 4:19 pm, Jeff Sharkey jshar...@android.com wrote: First, remember that PendingIntents may not be unique w.r.t extra bundles, which is why you want to use the setData() Uri. In the Activity or Service that you trigger with the

[android-developers] Re: Update widget from code

2009-05-07 Thread Carlos
Ok. But how to find the id to join it in the intent? When i update my widget, i do : updateViews.setOnClickPendingIntent(R.id.widget, pendingIntent); the pendingintent has an extra value with the widget id. How to get the widget id? Charles On May 7, 12:25 am, Jeff Sharkey

[android-developers] Re: Update widget from code

2009-05-07 Thread Jeff Sharkey
First, remember that PendingIntents may not be unique w.r.t extra bundles, which is why you want to use the setData() Uri. In the Activity or Service that you trigger with the PendingIntent, you can use getIntent().getData() to read back the Uri used to launch it, which includes any data you set

[android-developers] Re: Update widget from code

2009-05-06 Thread Carlos
Hello, I have a widget like the jeff's example. And i don't understand how to identify each widget (same type). getAppWidgetIds() returns a tab, how to catch the good id when i touch mywidget 1 or mywidget 2? Do you know a solution? Charles On Apr 23, 12:05 am, Al alcapw...@googlemail.com

[android-developers] Re: Update widget from code

2009-05-06 Thread Jeff Sharkey
When building the widget update, you can pack the appWidgetId into the PendingIntent. Through the setData() Uri usually works best. j On Wed, May 6, 2009 at 12:18 PM, Carlos canss...@gmail.com wrote: Hello, I have a widget like the jeff's example. And i don't understand how to identify

[android-developers] Re: Update widget from code

2009-04-22 Thread Tom Gibara
Yes, you can push updates to your widgets any time by obtaining an AppWidgetManager. Jeff Sharkey posted an example that performs an update within a Service. It includes this code that might help. // Push update for this widget to the home screen ComponentName thisWidget

[android-developers] Re: Update widget from code

2009-04-22 Thread Al
In Jeff's example, the service is started from his onUpdate method, which is called by AppWidgetProvider. This is different from what I'd like to do, I'd like to push an update to the widget from inside my activity, but with the correct int[] values. On Apr 22, 7:16 pm, Tom Gibara

[android-developers] Re: Update widget from code

2009-04-22 Thread Tom Gibara
That's true, but notice that his service has no dependency on the class implementing the onUpdate method, in principal anything in the application could invoke that service. You'll find the app widget ids available via the getAppWidgetIds() on AppWidgetManager. Tom. 2009/4/22 Al

[android-developers] Re: Update widget from code

2009-04-22 Thread Al
That worked, thanks. On Apr 22, 7:36 pm, Tom Gibara m...@tomgibara.com wrote: That's true, but notice that his service has no dependency on the class implementing the onUpdate method, in principal anything in the application could invoke that service. You'll find the app widget ids available