0

есть адаптер для listview.

<?xml version="1.0" encoding="utf-8"?>

<ImageView android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:background="@drawable/cost_button"
           android:id="@+id/imageView3"
           android:layout_alignParentTop="true"
           android:layout_alignParentRight="true"/>
<TextView android:layout_width="wrap_content"
          android:layout_height="30dp"
          android:id="@+id/text_time"
          android:textSize="30dp"
          android:text="r"
          android:textColor="@color/list_background"
          android:layout_below="@+id/imageView2"
          android:layout_alignLeft="@+id/imageView3"/>
<TextView android:layout_width="wrap_content"
          android:layout_height="30dp"
          android:id="@+id/text_cost"
          android:textSize="30dp"
          android:text="r"
          android:textColor="@color/about"
          android:layout_alignBaseline="@+id/text_time"
          android:layout_alignBottom="@+id/text_time"
          android:layout_toRightOf="@+id/imageView2"/>
<TextView android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/text_nametrain"
          android:textSize="20dp"
          android:text="fffffffffff"
          android:textColor="@color/about"
          android:layout_alignParentTop="true"
          android:layout_marginLeft="5dp"
          android:layout_toRightOf="@+id/imageView1"
          android:layout_toLeftOf="@+id/text_time"
          android:layout_alignBottom="@+id/imageView3"/>
<ImageView android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/imageView2"/>
<LinearLayout
        android:visibility="invisible"
          android:layout_width="match_parent"
          android:layout_height="30dp"
          android:layout_below="@+id/imageView1"
          android:layout_alignRight="@+id/imageView3">
<TextView android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/text_stations"
          android:textColor="@color/name"
          android:textSize="25dp"
          android:text="rrrr"
          android:layout_marginLeft="5dp"
        />
<TextView android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/how_often"
          android:textColor="@color/list_divider"
          android:text="rrrr"
          android:textSize="25dp"
          android:layout_marginLeft="180dp"
        />

есть вывод в listview

 ListView listview = (ListView) findViewById(R.id.listViewData);
        //Загружаем в него результат работы doInBackground
        listview.setAdapter(new ArrayAdapter<String>(ScreenTwo.this,
                android.R.layout.simple_list_item_1,  output));

вопрос: как вывести в адаптер данные

1 ответ 1

2

http://startandroid.ru/ru/uroki/vse-uroki-spiskom/113-urok-54-kastomizatsija-spiska-sozdaem-svoj-adapter.html

В методе getView указывается, что куда записывать. Он вызывается каждый раз, когда требуется отобразить элемент списка, который ранее был за пределами видимой части ListView

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.