I want to add a TextView and set its value dynamically to the ListView and by clicking on the item that I want to get the value of the item clicked.
I have an array
String[] statesList = {"listItem 1", "listItem 2", "listItem 3"};
My TextView XML is
<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:textSize="16sp" android:textStyle="bold" > </TextView>
My ListView XML
<ListView android:id="@+id/list" android:choiceMode="singleChoice" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:layout_marginTop="10dp" android:layout_width="290dp"/>
Please help me how can I set these values ββin an array in listview. i am new in android.Thanks
user2545733
source share