On Fri, Jul 23, 2010 at 12:26 PM, jarkman <jark...@gmail.com> wrote:
> I have a widget, working happily on 2.2, which includes this line:
>
>           views.setBoolean(R.id.s_button, "setEnabled", true);
>
> When I run it on 1.5, I get this:
>
> 07-23 17:11:59.643: WARN/AppWidgetHostView(158):
> android.widget.RemoteViews$ActionException: view:
> android.widget.ImageButton can't use method with RemoteViews:
> setEnabled(boolean)
>
> Unsuprisingly, the widget doesn't appear. But I'm not quite sure what
> is not supported here. RemoteViews.setBoolean is documented as
> supported since API level 3, and ImageButton.setEnabled has been there
> forever.
>
> Is there some separate question about which functions setEnabled is
> prepared to do business with ? Or, if not, what could possibly be
> wrong here ?

Not every method on View is available via RemoteViews. It has to be
flagged with @RemotableViewMethod inside the Android source code.

View's setEnabled() has that annotation, for the current code visible
via Google Code Search. Apparently, back in 1.5, that method did not
have that annotation.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 2.9 Available!

-- 
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

Reply via email to