The difference between removeViewInLayout() and removeAllViews()

by xhy » Mon, 24 May 2010 11:00:36 GMT

Sponsored Links
 hi all ,i inflate a xml nd add it to a mapview .But i want to remove it
when  i click a button.I must click the button two times sothat i can remove
it when i  use the  removeViewInLayout()  method ,but if
using removeAllViews() will do . Why?Thank you !

the code is:
add the view to mapview:

                 ll = (LinearLayout)mInflater.inflate(R.layout.bubble,null
         LayoutParams lp = new
ViewGroup.LayoutParams.WRAP_CONTENT, p, 0, -70,
 LayoutParams.MODE_MAP | LayoutParams.CENTER);


remove it:
            map.removeAllViews();     ////////ok
            map.removeViewInLayout(ll); ///////must click two times



Other Threads

1. Space greedy ListView

I'm building a simple view programmatically.  Boiled down,
it's something like this:

        LinearLayout l = new LinearLayout(this);

        TextView t = new TextView(this);

        ListView lv = new ListView(this);

        Button b = new Button();


This works fine.  Then I start adding items to
the ListView as certain actions happen in the
program.  When I get enough items, the button
gets pushed off of the bottom of the screen
and disappears.  How can I avoid this?

I'm also not sure how to anchor the button to
the bottom in the beginning when the ListView
has only a few items.  As it is, it hugs the
ListView and moves down as the list grows.




2. best way to storage data on android


I'm a newbie on Android dev. But I want to know what the best way to storage 
data on android....file or SQLite because...i want to save a list of 
restaurants with street address,  Lat and long, and pictures...and update it 
over internet....

Anybody has any reference to send me !?

Best regards
Igor Nesralla Ribeiro


3. RunTime Error

4. codec for .au

5. Problems accessing system properties in

6. drawLine problem with Paint.StrokeWidth = 1

7. Amazon AppStore Release