Problem in Android Spinner inside the Tabbars -
i making application , facing problem.
i using tab bars , in 1 of tab bar using spinner.
it loads when click on it. gives me:
android.view.windowmanager$badtokenexception: unable add window -- token android.app.localactivitymanager$localactivityrecord@44647ef8 not valid; activity running?
this error.
i using following code snippet
arraylist<string> agelist; spinner age; age = (spinner) findviewbyid(r.id.country); agelist = new arraylist<string>(); agelist.add("10-20"); agelist.add("21-35"); agelist.add("36-60"); agelist.add("61-100"); arrayadapter<string> adapter2 = new arrayadapter<string>(this, android.r.layout.simple_spinner_item, agelist); //array populating adapter2.setdropdownviewresource(android.r.layout.simple_dropdown_item_1line); age.setadapter(adapter2); age.setselection(0, true);
this code work fine when using seperate activity not tab bars. in tab bars gives me above error exception when click on spinner open list.
please guide me bunch
i m done problem layout
setcontentview(r.layout.age)
instead of used layout inflator below:
view viewtoload = layoutinflater.from(this.getparent()).inflate(r.layout.country, null); this.setcontentview(viewtoload);
and called spinner n bingooo! works perfect
thanks of you.. :)
Comments
Post a Comment