I found this great answer for creating custom action bars:
Android Split Action Bar with Action Items on the top and bottom?
I'm a bit confused on how they formed the bottom bar with the following code:
@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;
}
So the browser_main
is a menu with a list of items? I'm not sure how the RelativeLayout comes into play. I would like to implement my own RelativeLayout to the bottom bar but I'm not sure how it works. What would be included in the browser_main.xml
and media_bottombar.xml
. Also, what is the R.id.layout_item
?