私はオブジェクトのarraylistからのデータで人の名前と住所のリストを表示するリストアを持っています。ここまでリストビューを埋める方法があります。オブジェクトのarraylistからリストビューを取り込む
private void fillData(ArrayList<Person> messages) {
//populating list should go here
}
人物のクラスは店舗の名前と人物の住所です。
public class Person {
String name;
String address;
}
私のリストビューのための私のListItemが2つのTextViewで構成されますが、このように:
<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:mode="twoLine"
android:clickable="false"
android:paddingBottom="9dp"
android:paddingTop="5dp" >
<TextView
android:id="@+id/display_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/display_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/display_name"
android:layout_below="@+id/display_name"
android:textAppearance="?android:attr/textAppearanceSmall" />
私は一人一人の名前とアドレスの両方を表示するには、私のリストビューの各項目をしたいです。誰か助けてもらえますか?あなたの活動で
事前のおかげで、そして私の悪い英語のため申し訳ありません...
Googleカスタムリストビューで検索... – Pragnani
'onCreate'メソッドを使用できます。この場合、それはプログラマで使用可能であろう。ところで – user7275835