Is it possible to create ActionBar tabs from a fragment?
I use the ABS library and have 2 fragments. The data in the second fragment changes dynamically and is it possible to dynamically display tabs from the fragment?
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); for (int i = 1; i <= 3; i++) { ActionBar.Tab tab = getSupportActionBar().newTab(); tab.setText("Tab " + i); tab.setTabListener(this); getSupportActionBar().addTab(tab); } }
This is the code that I have and I get The method getSupportActionBar() is undefined for the type
source share