开发者

android how to put list of items for an submenu item

I want to add a no of items to an existing submenu with this xml:

<item android:id="@+id/chooseCountry" android:title="Choose Country">
    <menu>
        <item android:id="@+id/india" android:title="India" >
            <menu>
                <item android:id="@+id/blor" android:title="Bangalore" />
                <item androi开发者_开发技巧d:id="@+id/delhi" android:title="Delhi" />
                <item android:id="@+id/hyd" android:title="Hyderabad" />
            </menu>
        </item>
        <item android:id="@+id/pak" android:title="Pakistan" />
        <item android:id="@+id/africa" android:title="South Africa" />
    </menu>
</item>

I am getting but this exception:

08-15 12:57:50.942: ERROR/AndroidRuntime(312): java.lang.UnsupportedOperationException: Attempt to add a sub-menu to a sub-menu.

How can i add items to a submenu item?

Thank you

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜