how to remove a view

by Billsen » Thu, 11 Sep 2008 12:59:30 GMT

Sponsored Links

How to remove a view added by addContentView method?



how to remove a view

by hackbod » Thu, 11 Sep 2008 14:49:58 GMT

 setContentView() replaces any existing views.  If you want finer-
grained control, you can setContentView() a top-level layout manager,
which you can then add and remove views in as you desire.


Sponsored Links

how to remove a view

by Billsen » Sat, 13 Sep 2008 02:23:06 GMT

 Would you please provide a little more information?  I loaded
R.layout.main by setContentView(), then added a view with
addContentView. I need to remove the view added by addContentView by
clicking a button.



how to remove a view

by Kavi » Sat, 13 Sep 2008 03:12:25 GMT

 Look at the setVisibility method to change the visibility options for
the view. #setVisibility(int)

how to remove a view

by Billsen » Sat, 13 Sep 2008 04:56:39 GMT

 Thanks for your help. It works with setVisibility.


Re: how to remove a view

by Guilo » Fri, 20 May 2011 04:29:40 GMT

 I know it is old but I have the same problem. I want next to change the view 
added by addContentView. Indeed recalling addContenView throws an Exception 

05-19 22:28:31.785: ERROR/AndroidRuntime(11210): 
java.lang.IllegalStateException: The specified child already has a parent. 
You must call removeView() on the child's parent first.


Other Threads

1. Launching Google maps from another app


I want to launch the native google map app from my application and
pass some set of addresses so that google maps can show all the
addresses as markers.

All the examples that I have seen are where we can pass single address
(be a lat/long or the address) but there is no mention of the case
where we need multiple addresses to be displayed.

For single address these are the format I see on internet:

String geoUriString =
Uri geoUri = Uri.parse(geoUriString);
Intent mapCall = new Intent(Intent.ACTION_VIEW, geoUri);

Map Location can be: 1.<STRING name="map_location">"geo:0,0?q=123 +
abc street + def city+TX+ 75038 <STRING>

Any help here will be appreciated.


2. Android InApp Billing, how to get a list of ALL available Items (+ Infos)

I am currently struggling with the fact that the InApp-Billing API
billing_reference.html) does not support any type of "get all infos to
all purchaseable items of my app"-like methods.
Even in the Example Application "Dungeon Example" the names of the
items are defined harcoded in the ressources (res/values/strings.xml -

How should i create a proper selection screen of InApp-Billing items
if i can even load their data (name, price, id)? Defining the items
names and prices in the app (res/values/string.xml) again after i have
already defined them in the android market backend of my app seems
quite redundant to me.

Maybe i am all wrong, but this seems like a big mess to me.

An example: what if i need different currencies (for different
countries) and i want them to be displayed IN my Application BEFORE
the user clicks the buy button? Handling all the conversions and
current exchange rates is definitely a task i expected the InApp-
Billing API to do for me.

Anybody out there, who can shed some light on this?



3. emulator failed to startup with my system.img

4. ListView click events

5. Send Key Events to my Activity

6. Show ads in opengl app

7. File handling in android