开发者

Android: Use spinner in a sub tab

I'm trying to put a spinner in a sub-tab in my android app. Touching the spinner causes a crash.

Searching seems to suggest that for some reason it is not possible to use spinners in sub-tabs, but this seems silly to me. I've also tried using activity 开发者_StackOverflowgroups as an alternative to sub-tabs, but I get the same crash.

Has anyone resolved this?


I'm not really sure about this, but try initializing your Spinner in Java code with the context of the parent Activity, like

Spinner spinner = new Spinner(isChild() ? getParent() : this);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜