0

So here's the deal.

My app's layout is set up with a View Flipper. The View Flipper contains seven Linear Layout children (views). Each Linear layout then contains a List View. Each linear layout represents a different category in my app.

And here is my dilemma.

Currently my layout is pretty static and bland, so I want to be able to give users the ability select any number of the available categories. This will mean I will have to be able to dynamically create and remove Linear Layouts, each with its own List View. There's also the question of creating and removing Array Adapters for my List Views.

Any suggestions?

ababzy
  • 687
  • 10
  • 16

1 Answers1

0

How can I disable all views inside the layout?

With this link you can find three approaches : disabling, removing and hiding.

Then if you want to add something after this, you can do it in your java code :

ViewFlipper mVF = (ViewFlipper) findViewById(R.id.my_ViewFlipper); //retrieve your ViewFlipper if it is in an xml file.
LinearLayout lila1 = new LinearLayout(this);
ListView livi1 = new ListView(this);
lila1.addView(livi1);
mVF.addView(lila1);
Community
  • 1
  • 1
mthpvg
  • 3,789
  • 3
  • 26
  • 34
  • What about array adapters for the List Views – ababzy Sep 06 '11 at 12:57
  • For the ListView it would work see : http://stackoverflow.com/questions/4540754/add-dynamically-elements-to-a-listview-android. For the LinearLayout try the stuff above. – mthpvg Sep 06 '11 at 13:21
  • If I am not mistaken, it looks like that link is useful for one list view. The thing is I have many list views being created dynamically. I am not sure how that link applies. – ababzy Sep 06 '11 at 15:02
  • You haven't fully answered my question. – ababzy Sep 06 '11 at 19:32
  • Sorry it s because I don t know how. As far as I am concerned I d do it all programmatically with some : removeAllViews/addView. – mthpvg Sep 07 '11 at 07:17