When I created a new activity, it extends ActionBarActivity but it's deprecated.
At that moment, I have two options:
1) Used Activity
and android:Theme.Material
in my style like that :
<style name="AppTheme" parent="android:Theme.Material">
Or
2) Used AppCompatActivity
and Theme.AppCompat
:
<style name="AppTheme" parent="Theme.AppCompat">
So my question is, what is better between Activity and AppCompactActivity to use Android Material Design and Toolbar ?
It isn't a matter of which is "better". Which one you should use depends on what versions of Android you are supporting.
Theme.Material
is only available on devices running API 21 (Lollipop) and up. If you wish to use the Material theme on devices running API 20 and below, you need to use AppCompat.
When I created a new activity, it extends ActionBarActivity but it's deprecated.
This is a very recent change. As of version 22.1 of AppCompat, ActionBarActivity
has been deprecated in favor of AppCompatActivity
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With