Reputation: 538
I am learning Android development but I am really getting confused by all the AppCompat stuff. I may be wrong, but AppCompat allows the use of modern elements like Material Design on older Android version (lower than API 21). That's cool, but for the purpose of my learning, I wanted to create a pure API 21+ application, without caring about retro compatibility.
So I could use the "native" android:Theme.Material instead of Theme.AppCompat.xxx. But when it come to Toolbar it seem that I can't use it without a AppCompatActivity...
It's really confusing for me, Google seems to release new components that are only compatible on API 21+ but you can't use them without using retro-compatible activities ??
If someone could clear things out a bit, I would greatly appreciate that.
Upvotes: 0
Views: 432
Reputation: 1007658
But when it come to Toolbar it seem that I can't use it without a AppCompatActivity
Bear in mind that there are two Toolbar
classes:
android.widget.Toolbar
, which is available on Android 5.0+ (API Level 21+)
android.support.v7.widget.Toolbar
, which requires appcompat-v7
and AppCompatActivity
and all of that, but will work going back to API Level 14 (and, with older versions of appcompat-v7
, back to API Level 7)
So, you choose the Toolbar
implementation that matches your chosen environment.
Upvotes: 3