I have an imageview and a text view in a widget layout.
Now I need to remove the image view from the remoteview programatically.
I see that there is the api remoteView.removeAll(Viewid);
So when I do
remoteViews.removeAll(R.id.imageView);
and update the remoteView through
appwidgetmanager.updateAppVidget
nothing concrete is visible on the screen.
the imageview is still there.
Am I on the correct track?
Kindly give your suggestions on this.
The function
removeAllis the equivalent ofViewGroup.removeAllViews. For it to work in a widget through a RemoteViews object you would need to have yourImageViewwrapped within aFrameLayout. You can then callremoveAlland pass the id of thatFrameLayout.Note that setting the visibility to INVISIBLE or even GONE is much easier with RemoteViews, and does not require extra
Views.