android - Extending Activity or ActionBarActivity -



android - Extending Activity or ActionBarActivity -

i'm creating app includes back upwards android lolipop , before versions.

based on maintaining compatibility documentation planned utilize actionbaractivity appcompact non lolipop devices , fragmentactivity material lolipop devices.

i created 2 different value folders.

now problem how should extend activity class

myactivity extends activity

or

myactivity extends actionbaractivity

if utilize activity. crashes on before android version , saying me add together actionbaractivity , vice versa happens lolipop

edit ------

values-21

<style name="apptheme" parent="android:theme.material.light">

values

<style name="apptheme" parent="theme.appcompat.light">

you extend actionbaractivity if you'll using actionbar on api s lower 11 back upwards api >=7 check out http://developer.android.com/guide/topics/ui/actionbar.html

also can source of confusion when utilize actionbaractivity theme must kid of 1 of theme.appcompact descendents such

<style name="mytheme" parent="theme.appcompact"> <item name="android:colorprimary">@color/accent_1</item> <item name="android:colorprimarydark">@color/accent_dark</item> <item name="android:coloraccent">#f00</item> <item name="colorprimary">@color/accent_1</item> <item name="colorprimarydark">@color/accent_dark</item> <item name="coloraccent">#f00</item> </style>

the non prefixed android:provide material theme compatibility talked want users of < api 21 (lollipop)

android material

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -