I have a spinner in my home.class. When I click on the spinner, the process is stopped showing exception that WindowManager$BadTockenException is caught.
I am callin
The error may be with the setContentView given inside your home.class.
Instead of setContentView(yourlayout);
give,
View viewToLoad = LayoutInflater.from(this.getParent()).inflate(yourlayout, null);
this.setContentView(viewToLoad);
Spinner s2 = (Spinner) viewToLoad.findViewById(R.id.spinnerCountry);
And give your spinner code as:
ArrayAdapter<CharSequence> adapterCountry=new ArrayAdapter(this.getParent(),android.R.layout.simple_spinner_item,country);
adapterCountry.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
s2.setAdapter(adapterCountry);
Since you are using activity group, you face this issue. Hope this solution may help you.