problems removing childs from view

by DaRolla » Wed, 29 Apr 2009 18:11:03 GMT


Sponsored Links
 hello,

I have some problems removing views.

Inside my xml I have a LinearLayout with a ScrollView with a
TableLayout.

Into this I am adding (using Java) childs, which are LinearLayouts (no
TableRows).

This works fine.

Now I want to remove some childs, which are LinearLayouts.

linearlayout.setVisibility(View.GONE) works finde but doesnt remove
the Object itself.

tablelayout.removeView(linearlayout) works only under strange
circumstances: removing the last element of my list works fine.
removing some element in the middle throws this exception:

                                Uncaught handler: thread main exiting due to 
uncaught exception
                                java.lang.NullPointerException
                                at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1207)
                                at 
android.view.ViewGroup.drawChild(ViewGroup.java:1434)
                                at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
                                at android.view.View.draw(View.java:5571)
                                at 
android.widget.FrameLayout.draw(FrameLayout.java:324)
                                at 
android.view.ViewGroup.drawChild(ViewGroup.java:1436)
                                at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
                                at 
android.view.ViewGroup.drawChild(ViewGroup.java:1434)
                                at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
                                at 
android.view.ViewGroup.drawChild(ViewGroup.java:1434)
                                at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
                                at 
android.view.ViewGroup.drawChild(ViewGroup.java:1434)
                                at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
                                at android.view.View.draw(View.java:5465)
                                at 
android.widget.FrameLayout.draw(FrameLayout.java:324)

linearlayout.removeAllViews() I tried in order to clear all childs of
my linearlayout (which are some buttons and textviews in fact), but
this doesnt change anything.

Any idea what I am doing wrong?

Greetings,
DaRolla
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Mind Rattling Logical Game 鈥楾witty鈥?Now Available In The Android Market

Hi All,

Twitty a thrilling puzzle game with exciting levels to beat. This logic game
will give a tug to your brain. Take up the challenge and become the ultimate
savior of the cute little birds waiting to get into their respective
destination. Twitty will definitely keep you amused throughout the game.

Twitty is now available for all Android devices. The game can be download
through the Android Market or online at
https://market.android.com/details?id=com.dumadu.twitty.

Regards,
Dumadu Games.

-- 
.

2. problem after generate a .apk file

Hi,

I make a app on eclipse , win 7 ....after this I go on menu export and run
it....i export apk file and its seems to be ok for me....i published it on
the market...and finish(
https://market.android.com/details?id=com.riosistemas.butecos&feature=search
_result )....But the problem goes after this process.... when I open my
project again in eclipse to make some changes....all my manifest file was
change(my application information was disappear)...and  I can debug on my
phone too....

What I'm do wrong ? I have to create another project and rewrite all
manifest file ? anybody help me !?


Thanks in advance
Igor Nesralla Ribeiro

-- 

3. Query regarding getFlags() of Intent

4. Moto Defy vs Desire HD vs G2X bagus mana ya ?

5. Developing on Inspire 4G

6. Insights for using query() and MediaStore.Audio.Albums

7. Adding a new local git project