Reputation: 294
I have a strange "problem" on my Android Studio 0.9.9, and still on the version 1.
Since this update, when i create a new project android studio doesn't create a blank activity. It should be "MainActivity extends Activity", but it's "MainActivity extends ActionBarActivity"
I have a second problem as well. When i'm editing Layout Files, on the Preview of the Layout, i can't see the ActionBar (But i don't have this problem when i'm editing previous project)
I really don't know where this problem is coming from. Maybe a problem in the configuration of Android Studio, but i didn't change anything. Or maybe it's just some new features.
I'm new in Android Development so it might be my lack of knowledge.
Has Someone had this problem before ? Any hint or advice on this?
Is my explanation lucid?
Thanks for your help !
EDIT :
After some search, i found some post from StackOverflow :
By default android creating new project as ActionBarActivity
android adt bundle automatically extending ActionBarActivity and adding fragments and more stuff?
Upvotes: 2
Views: 3708
Reputation: 1118
Starting with Support Library 22.1 (blog post):
In this release,
ActionBarActivity
has been deprecated in favor of the newAppCompatActivity
.
Has Someone had this problem before ? Any hint or advice on this?
This is not a problem but intended to help you apply the new design language by Google, named Material Design. One major change is the new UI widget called Toolbar. To use it you have to extend from ActionBarActivity
as mentioned in a recent blog post by the Android developers. In this blog post you will also find more information about the Toolbar widget.
So if you're new, Google is just trying to help you to get right on track with the new elements and styles.
Upvotes: 2
Reputation: 1047
i also feel strange for that it extends the actionbaractivity,some days before when i create a project and set minsdk to 14,it extends activity and use holo theme when under lollipop ,but today i do the same thing and found it didn't derive from the activity and use the appcompat theme only,indeed one new feature for appcompat library is that it Added support for material design user interfaces. maybe extends actionbaractivity is for the sake of using the newest theme,because under lollipop you can't use material theme,use appcompat is the quickest way, i don't know google's manner for the holo theme now.
Upvotes: 0
Reputation: 3441
In your resources
xml file, your Action Bar
style should have a parent. Something like:
<style name="MyActionBar" parent="@style/Widget.THE_STYLE_YOU_WANT"> //HoloDark, MaterialLight, ect
<item name="android:background">custom color</item>
</style>
Upvotes: 0