Re: [android-developers] Re: Modifying components on widget from activity

2010-07-12 Thread Vincent Tsao
i almost missing this great thread, Mark & Dirk, thank you

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Modifying components on widget from activity

2010-04-19 Thread Dirk Vranckaert
Thx Mark, that did it for me :)

On 17 apr, 19:18, Mark Murphy  wrote:
> Dirk Vranckaert wrote:
> > On my widget I'm having a button and a textView. When clicking that
> > button some data is registered and I want the TextView to be updated.
> > However I can't get to the TextView instance from within my Activity
> > it seems.
>
> > Any ideas?
>
> Use a RemoteViews, as that is the only way to update an app widget.
>
> ComponentName me=new ComponentName(this, AppWidget.class);
> RemoteViews updateViews=new RemoteViews("apt.tutorial", R.layout.widget);
> AppWidgetManager mgr=AppWidgetManager.getInstance(this);
>
> // populate the RemoteViews
>
> mgr.updateAppWidget(me, updateViews);
>
> You will need to substitute in appropriate values for AppWidget and
> apt.tutorial, but you should have most of that from your IntentService
> or AppWidgetProvider already.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android 2.x Programming Books:http://commonsware.com/books
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en