Problems with calling method within RemoteViews object

by Romain Guy » Sun, 29 Nov 2009 12:20:50 GMT


Sponsored Links
 Not all View methods can be used on RemoteViews.




During creation of Widget views(RemoteViews) I'm trying to set
"actions" for inner View objects such as ImageView, LinearLayout and
others. But some calls are being processed correct but others are
throw exceptions. Simple code from update widget method example is
below.


RemoteViews widgetViews = new RemoteViews(context.getPackageName(),
               R.layout.widget_layout);

//this call is correct
widgetViews.setInt(R.id.ClientLayout05, "setVisibility",
View.INVISIBLE);


//the following code writing to LogCat
//updateAppWidget couldn't find any view, using error view
//android.widget.LinearLayout can't use method with //RemoteViews:
setBackgroundResource(int)"
widgetViews.setInt(R.id.ClientLayout05, "setBackgroundResource",
R.drawable.background_widget_button_transparent);

--



Other Threads

1. How to get the currently foreground activity class name?

Hi, does any one konw how to get the currently foreground activity
class name?  In my project, I need  get the info of the foreground
activity, not only my own application, but also the third party
application.

--~--~---------~--~----~------------~-------~--~----~

2. How to play Video files from MediaStore

Hi everybody..
 Can anyone help me in this?
I would like to list the video files available in the provider and
playing according to user selection.

Thanks,
Ramesh.

--~--~---------~--~----~------------~-------~--~----~

3. who can tell me how to achieve this function?! thx!

4. Where is the source code for "Pictures" app

5. Please help! Having problem with wave locked service. it still going sleeping.

6. Displaying image from internet source

7. Displaying Dialog with no dim on background window.