1

私のアプリケーションでは、アダプターを使用しています。ここを叩いた。実際には、以下のようにxml/filename.xmlを表示する必要がありました。

以下のコードのように表示したい。

私はすでにこれを手動で行っていますが、レイアウトを呼び出すような方法はありますか? xml >layout> filename.xmlそしてそれは表示されます

このようなコーディングを xml ファイルに res/xml/.. にするにはどうすればよいですか?

<cursor-adapter xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res/com.example.android.xmladapters"
      app:uri="content://com.android.contacts/contacts"
      app:selection="has_phone_number=1"
      app:layout="@layout/contact_item">

      <bind app:from="display_name" app:to="@id/name" app:as="string" />
      <bind app:from="starred" app:to="@id/star" app:as="drawable">
            <map app:fromValue="0" app:toValue="@android:drawable/star_big_off" />
            <map app:fromValue="1" app:toValue="@android:drawable/star_big_on" />
      </bind>
      <bind app:from="_id" app:to="@id/name" app:as="com.example.android.xmladapters.ContactPhotoBinder" />

    </cursor-adapter>
4

0 に答える 0