V
V
Vitaly2015-07-18 22:23:40
Android
Vitaly, 2015-07-18 22:23:40

How to set ActionBar when inheriting from Activity class?

In an application that supports min. API 16 Android I want to use ActionBar, but I want to inherit MainActivity from Activity class, not from ActionBarActivity. How can this be implemented? After all, as I understand it, the toolbar on API 16 will not work (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Emin, 2015-07-18
@Darkel

What for? Well, put the AppCompat theme with ActionBar. Please note that now instead of ActionBarActivity, you need to inherit from AppCompatActivity.
UPD: check which FragmentManager you are using. With AppCompatActivity, you need to use SupportFragmentManager. A similar problem is googled in 3 seconds.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question