how to remove a view

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


Sponsored Links
 Hi,

How to remove a view added by addContentView method?

Thanks,
Billsen

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



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.

Thanks,
Billsen





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



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.

 http://code.google.com/android/reference/android/view/View.html #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. how to read the app package under /data/app

Hi All,

I want to read out the binary content of the .apk packages installed in
/data/app. Not only the package information, but the content of the package
itselt.
How can I do that.
Thanks a lot,

James

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

2. Eclair install choked with errors about locks and died horribly leaving corrupted install

Followed the instructions in
http://developer.android.com/sdk/adding-components.html for adding 2.0 as
components to an existing 1.6 SDK, from within Eclipse.

It didn't work. Not by a long shot. Instead, it got partway through and then
said that C:\android-sdk-windows-1.6_r1\
temp\DocPackage.new01 couldn't be copied because of a lock, and similarly
for PlatformPackage.new01.

It said to shut down running programs, but the only program running was
Eclipse, which was needed to do the upgrade.

The cancel button was disabled, and the close box didn't work. Shutting down
Eclipse killed it, but left C:\android-sdk-windows-1.6_r1 in a corrupted
state. Restarting Eclipse showed the Android projects with errors, no SDK,
and a disabled Android SDK and AVD Manager (which means no ability to rerun
the install).

Shutting down Eclipse, renaming the corrupted SDK directory, unzipping 1.6
again into C:, and restarting Eclipse made it as if nothing had ever
happened, which is good. But it is not possible to complete the install from
Eclipse, which is bad.

The dialog says:

Failed to rename directory
C:\android-sdk-windows-1.6_r1\temp\DocPackage.new01 to
C:\android-sdk-windows-1.6_r1\docs
-= Warning ! =-
A folder failed to be renamed or moved. On Windows this typically means that
a program is using that folder (for example Windows Explorer.) Please close
all running programs that may be locking the directory
'C:\android-sdk-windows-1.6_r1\temp\DocPackage.new01' and try again.

Failed to rename directory
C:\android-sdk-windows-1.6_r1\temp\DocPackage.new01 to
C:\android-sdk-windows-1.6_r1\docs
-= Warning ! =-
A folder failed to be renamed or moved. On Windows this typically means that
a program is using that folder (for example Windows Explorer.) Please close
all running programs that may be locking the directory
'C:\android-sdk-windows-1.6_r1\temp\DocPackage.new01' and try again.
Installed: SDK Platform Android 2.0, API 5 (tools rev: 3)

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

3. My layout doesn't fit on WVGA emulator skin , any help?

4. How to remove contact from a group]]

5. Issue with Android Debug Bridge

6. 3D Developers - Motorola Droid OpenGL ES Specs are in

7. cant see my text box while typing on soft keypad