I've implemeted spinner like here . And now I want to place spinner in ActionBar (setting spinner as CustomView to actionBar) but it doesn't appear there :(
Spinner spinner = (Spinner) findViewById(R.id.planets_spinner);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.planets_array, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
actionBar.setCustomView(spinner);
and here is .XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/parkfragment"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<Spinner
android:id="@+id/planets_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
Please, don't suggest to use ActionBar DropDown List, I can't use it because I'm already using ActionBar Tabs. android doesn't allow to use them both at the same time. Any help will be appreciated