To solve this problem, I used a custom view as an action bar:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ActionBar actionBar = getActionBar(); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); View view = View.inflate(getApplicationContext(), R.layout.actionbar, null); actionBar.setCustomView(view); }
and then for the bottom panel, I inflated my menu or whatever you want to see below:
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.browser_main, menu); RelativeLayout relativeLayout = (RelativeLayout) menu.findItem( R.id.layout_item).getActionView(); View inflatedView = getLayoutInflater().inflate( R.layout.media_bottombar, null); relativeLayout.addView(inflatedView); return true; }
In the Android manifest, I also included (android: uiOptions = "splitActionBarWhenNarrow") like this:
<application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" android:uiOptions="splitActionBarWhenNarrow" > ....
roomtek Dec 05 2018-12-12T00: 00Z
source share