Replacing ActionBarActivity to AppCompatActivity

The following article was mentioned that ActionBarActivity is dead and you should use AppCompatActivity.

https://plus.google.com/+AndroidDevelopers/posts/LNyDnnBYJ8r

So, I tried to change my private application from ActionBarActivity to AppCompatActivity.
In usually, it is enough to replace extend ActionBarActivity to extend AppCompatActivity. But I enchanted a issue regarding theme.

In ActionBarActivity case, I use the following theme as style.

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">

Then, my tests failed because MainActivity can’t adopt style of theme correctly.
I can avoid the error with the following modification.

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">

Then, I succeeded to replace ActionBarActivity to AppCompatActivity.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.