Before we build our ListAdapter,
we need to create another AXML sheet for the CustomCell, add another file to the Resources | layout folder called CustomCell.xml
, and implement the following:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent" android:weightSum="4"> <TextView android:id="@+id/username" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" /> </LinearLayout>
This is another simple layout which has one TextView
wrapped in a LinearLayout
. The TextView
will display the ConnectionId
for each Client
.
Now let's get back to the ListAdapter
. Inside the Views
folder, add another file called ClientsListAdapter...