3

I need to add a button to FragmentTabHost. How to build something like this?

FragmentTabHost

FragmentTabHost tabHost = (FragmentTabHost) view.findViewById(R.id.tab_host);

tabHost.setup(getActivity(), getActivity().getSupportFragmentManager(),
        R.id.tab_content);

tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("TAB 1"),
        MatchStatisticsFragment.class, null);

tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("TAB 2"),
        EventsListFragment.class, null); 
// can I add right-align button there? 
Ben
  • 51,770
  • 36
  • 127
  • 149
Anton Holovin
  • 5,513
  • 1
  • 31
  • 33

1 Answers1

2

Its the menu button, shown icon only

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/new_game"
          android:icon="@drawable/icon"
          android:title="@string/title"
          android:showAsAction="always"/>
</menu>
Sam
  • 546
  • 3
  • 16