Printing in TwoLineListView in android
I wonder if it is possible to print in TwoLineListView like in TextEdit? For example if I want to print some word in line1 and translation in line2? Is there anything like twolinedtextview.add("word,"translation"); ? I need my text to appear in listview when i press the button.
1. If you are using default ArrayAdapter with the ListView, then you can use ONLY ONE TextView.
2. But you can very well do this with the help of Custom adapter by using BaseAdapter or ArrayAdapter..
See this link for an easy tutorial:
you can subclass ArrayAdapter class, override getView(), and construct your rows yourself. The getView() method is responsible for returning a View, representing the row for the supplied position in the adapter data.
If you don't want to extend ArrayAdapter (like the others suggested), you can always use a SimpleAdapter
Here's a short tutorial about using it for 2 line list.