I need to have a listview like it is having for the following android application
Since I cannot post the image this is how it should be
INAGE Over here | Some Free text | User name etc
Here is your task
Task 1 >
Task 2 >
Task 1 & Task 2 are the list which would be dynamically picked up from the DB
I am trying to have a list with a textview the problem is that I can only get the List or the text view not both any point of time I have even tried relative layout in that case i see the text overlapping
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/g_tracker_layout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/question1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoLink="all"
android:text="@string/question1"
/>
<ListView android:id="@+id/ListView01"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
Any help guidance would be really helpful in achiving the layout similar to this
Following is the snippet in the onCreateMethod()
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.g_tracker_home);
this.dh = new TrackerDAO(this);
lv1=(ListView)findViewById(R.id.ListView01);
trackerObj = dh.selectAll();
if(trackerObj!=null) {
List<String> al = new ArrayList<String>();
for(Tracker obj : trackerObj ){
al.add(obj.getTrackerName());
}
lv1.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1 , al));
}