views:

65

answers:

1

Hi, 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 groups as an alternative to sub-tabs, but I get the same crash.

Has anyone resolved this?

A: 

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);
cfei
Thanks for the suggestion, but no change. Still gets the same error
Brian