addContenView - but how to removeView?

Put your problem here if it does not fit any of the other categories.

addContenView - but how to removeView?

Postby snowtiger » Fri Feb 01, 2008 12:27 pm

Hi there,

seems to be a simple question/task.

I add views using Java (XML sux :evil: ) with <activity>.addContentView(View view), but i have found no way to remove this view again.
Within a certain view, I can remove children using removeAllViews() or removeView(View view).

I tried <activity>.getWindow().getWindowManager().removeView(view), but it throws an error, so i tried to add my view with: <activity>.getWindow().getWindowManager().addView(View view), but this gives an error too :(

I just want to remove the view added with addContentView(View view);
snowtiger
Developer
Developer
 
Posts: 34
Joined: Fri Dec 21, 2007 10:44 am

Top

Postby plusminus » Fri Feb 01, 2008 6:59 pm

Hello snowtiger,

except setVisibility(...) on the View I have no 'solution' right now.

Note: WindowManager.removeView(view) is not yet listed in the SDK-Documentation :arrow: it is not expected to work properly :!:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby _tek_ » Tue Mar 10, 2009 12:37 am

I use a combination of setVisibility(View.INVISIBLE) and getLayoutParams().height = 0;.... Unfortunately removeView always through an exception, anyone else get it to work?

plusminus wrote:Hello snowtiger,

except setVisibility(...) on the View I have no 'solution' right now.

Note: WindowManager.removeView(view) is not yet listed in the SDK-Documentation :arrow: it is not expected to work properly :!:

Regards,
plusminus
_tek_
Freshman
Freshman
 
Posts: 2
Joined: Sun Mar 01, 2009 12:43 am

Postby reynolds » Mon Mar 16, 2009 11:10 am

huh!? what??? does this mean, there's no really a way to remove or destroy a View??? no kidding!!!???

ehem...

seriously... with the power to create there must be its opposite... the power to destroy. Android being backed by Google, with LOTS of great developers has or already knows this... that's kind of a conflict... its really quite illogical and hard for me to accept... I must expect there is a way to do this... ugh...

um... ...help?
reynolds
Junior Developer
Junior Developer
 
Posts: 22
Joined: Fri Mar 06, 2009 6:13 am
Location: Makati Philippines

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests