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.

Answers


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:

http://techdroid.kbeanie.com/2009/07/custom-listview-for-android.html


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.


Need Your Help

Select Date delivers wrong results

mysql date

I'm trying to return some results from my database where the column date_order is 1970 but the query also returns dates from 2014 and 2015. I have tried a couple query's but its all the same.

c/c++ NLP library

c++ c nlp open-source pos-tagging

I am looking for an open source Natural Language Processing library for c/c++ and especially i am interested in Part of speech tagging.