I just want to make a Single Choice ListView with two TextViews (side by side in a row).
Actually I want it to let a user select a Product according to its Size-price values. These values are shown in that ListView with those two TextViews representing Size-Price values.
The problem is that I am not able to make it a single choice list (also showing a radio Button in front of it). Below is the row layout I am using for it:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:id="@+id/rowLayout" >
<TextView
android:id="@+id/tv_size"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:text="Size"
android:textSize="15sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Price"
android:textSize="15sp" />
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right" />
</LinearLayout>
Please tell how to code with Java for that. If it is possible with simple_list_item_2 layout then how ?