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);
精彩评论