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. Ubuntu 64-bit x86 Android build: lib32z1 and lib32z1-dev packages are needed

I successfully compiled the Android source on a Ubuntu & Kubuntu AMD64
platform with Intel EM64T architecture. The only thing is that the
lib32z1 and lib32z1-dev
Debian packages both need to be installed to make the build complete
successfully with all the other build dependencies listed on [HTML]
http://source.android.com/download[/HTML]

 When first compiling with only the zlib1g and zlib1g-dev packages, it
was ending in an Error 2: not being able to find a valid libz.so after
a -lz search giving hits in a few different directories, but not
finding a valid lib. So I searched the repositories and installed the
lib32z1 deb package, and it still ended in the same error. Then I
installed the lib32z1-dev package and it compiled like a charm. I
believe the zlib1g* libs are 64-bit compiled, and since it is
compiling for a 32-bit target, it needs the 32-bit compression
Z-library.

 There were no major compilation errors that stopped the build after
the lib32z1 packages were installed, and the make completed
successfully.

 Hopefully this will help others!

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. How to use BitmapFactory.decodeStream to specify the size of my output Bitmap?

Hi,

I have the following code which I tried to build a Bitmap from an
input stream and I want my output bitmap to be 20 x 20:

   BitmapFactory.Options opts = new BitmapFactory.Options();
        opts.outHeight = 20;
        opts.outWidth = 20;

   InputStream stream = // an input stream to my image
   Bitmap bm = BitmapFactory.decodeStream(stream, null, opts);

But when I tried it, I do get a bitmap from the inputstream, but it
does not scale it to 20x20 which I specified in the
BitmapFactory.Options.

Can you please tell me what am I missing?

Thank you.

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

3. dip and setting values in code

4. How to hide user dictionary? or suggested words on keyboard

5. How to hide user dictionary? or suggested words on keyboard

6. Getting Audio Metadata

7. Traffic filtering options