Replacing ActionBarActivity to AppCompatActivity

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

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s