Zielpak
Zielpak

Reputation: 98

Android listview and list view template

I'm begining android developing and I would ask a question:

 StableArrayAdapter adapter = new StableArrayAdapter(this,
                android.R.layout.simple_list_item_1, list);

I'm making here a adapter which layout is a builded layout.simple_list_item_1.xml and looks that:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceListItemSmall"
    android:gravity="center_vertical"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:minHeight="?android:attr/listPreferredItemHeightSmall" />

but if I want to make my own list item named "symply" in layout folder with this same xml code Android-Studio tells me that "Cannot resolve method symply". Of course i changed to

StableArrayAdapter adapter = new StableArrayAdapter(this,
                    android.R.symply, list);

What I should do?

Upvotes: 0

Views: 1146

Answers (1)

Saurabh Rajpal
Saurabh Rajpal

Reputation: 1557

You have to use R.layout.symply and not android.R.symply

Upvotes: 2

Related Questions