How to show Widget when click a button?

I want to show/hide a widget when clicking on a button in GUI ? is it possible to control the appearance of the widget in the home screen grammatically ?

Answers


If you mean an app-widget that seats on the home screen, I don't think it's possible unless the home screen application is yours also. App-widgets are running in the process of the home screen application and the API for them is very tight, they are using remoteviews instead of views and there are very little things you can do with remoteviews.

The appearance basics of an app-widget like the position and the visibility are controlled by the home screen application. It is possible though to change the visibility or the appearance of the elements inside the app-widget but not for the app-widget itself.

For example you can hide all of the elements of an app-widget so the user can not see it but the space it consumes will not be available for other widgets. I am also quite sure that you can not control the position of the app-widget on the home screen, I have developed some of them and I can not find a way to know where are they positioned by the user.

Hope this helps...


Need Your Help

Setting HTTP headers with Jetty

configuration jetty

What's the best way to set HTTP headers (based on filename patterns) in Jetty 6.1? Is it possible via jetty.xml (or jetty-web.xml)? Or do I have to modify web.xml?