Skip to content

Add Item in looop #9

@EMIN3M1986

Description

@EMIN3M1986

Hi.
I'm trying to add item in a for loop, But it has error :" Binary XML file line #13: You must supply a layout_width attribute. "

I'm using this code in onCreate() method:

    List<ParseObject> list = null;
    try {
        list =  query.find();
    } catch (ParseException e) {
        e.printStackTrace();
    }

    for (int i = 0; i < list.size(); i++) {
        addItem(new SwitcherItem(getApplication(), String.valueOf(i)).setTitle(list.get(i).getString("title")));
    }

The list has 6 items.

I also added them to activity

    <activity
        android:name=".Activity.SettingActivity"
        android:label="@string/title_activity_setting"
        android:theme="@style/MaterialSettingsTheme">
    </activity>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions