How to use multiple listviews in a single activity on android? -


I have 9 list views that should come under the same activity. All lists can be displayed on screen at once (good at all times)

here only The activity is a decent solution for more than one ListView, first of all the important layout file (copy from, good job!). Note that ListViews are embedded in their LinearLayouts, which are evenly weighted.

"& gt; ListView Android: id =" @ + id / list1 "Android: layout_height =" fill_parent "Android: layout_width =" fill_parent ">

  // start Java code (you can understand import) public class enhances AnActivity activity {Private ListView lv1 = null; Private Sue Private string s2 [] = {"R", "S", "S", " Override public zeros on @reate (bundle saved instanestate) {super.naught (savedinstenstate); setContentView (s), "T", "U", "V", "W", "X"}; R.layout.main); // Get UI context // lv1 = (ListView) findViewById (R.id.list1); Lv2 = (ListView) findViewById (R.id.list2); Lv1.setAdapter (new array adapter & lt; string & gt; (this, android.R.layout.simple_list_item_1, s1)); Lv2.setAdapter (new array adapter & lt; string & gt; (this, android.R.layout.simple_list_item_1, s2)); } // onCreate ()} // class  

Sorry if there are any typo, I am editing right here in the window, not eclipse in the eclipse!


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -