Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RemoteViews setLayoutParams?

I would like to set the height of a TextView to WRAP_CONTENT remotely.

How would I do that, since there is no remoteviews.setLayoutParams(viewId, param) function?

I tried remoteviews.setInt.(viewId, "setHeight", -2), but that just sets the height of the TextView to zero...

Thanks!

like image 353
Nick Avatar asked Jul 25 '10 20:07

Nick


1 Answers

When you create the RemoteViews, pass in a resource ID to the constructor that has the TextView set to height set to wrap_content. Remember that when you send updates over, you are effectively redrawing the app widget, so you can use your layout files to affect changes that you cannot do via methods on RemoteViews.

like image 67
CommonsWare Avatar answered Nov 15 '22 08:11

CommonsWare