java - How to use the two_line_list_item in android? -


i have listview , following adapter:

arrayadapter<item> adapter = new arrayadapter<item>(this, android.r.layout.two_line_list_item, items); 

where items has following type: arraylist<item>

the class items looks like:

public class item {      string foo1;     string foo2;      public string getline1() {         return foo1;     }     public string getline2() {         return foo2;     } } 

but not working. not possible implement simple way?

is not possible implement simple way?

no, because not how arrayadapter works. welcome create own subclass of arrayadapter, override getview(), , fill in android.r.id.text1 , android.r.id.text2 getline1() , getline2().


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -