android - Difference between extending LifecycleActivity,Activity,ActionbarActivity & AppCompactActivity? -
in android main difference between extending lifecycler activity, activity,actionbaractivity & appcompactactivity? how these classes differ each other in terms of usage?
- extending
actionbaractivitygivesactionbars functionality on every api level >= 7 - by extending
activitycan avoid adding additional projects/libraries project you'll lackactionbaron api levels below 11
edit: more details:
actionbaractivity part of support library. support libraries used deliver newer features on older platforms. example actionbar introduced in api 11 , part of activity default (depending on theme actually). in contrast there no actionbar on older platforms. support library adds child class of activity (actionbaractivity) provides actionbar's functionality , ui
edit2: update april 2015 - looks actionbaractivityis deprecated in revision 22.1.0 of support library. appcompatactivity should used instead.
edit3: update aug 2017 - lifecycleactivity lifecycleowner but:
"since architecture components in alpha stage, fragment , appcompatactivity classes cannot implement (because cannot add dependency stable component unstable api). until lifecycle stable, lifecycleactivity , lifecyclefragment classes provided convenience. after lifecycles project released, support library fragments , activities implement lifecycleowner interface; lifecycleactivity , lifecyclefragment deprecated @ time."
(copied architecture components guideline)
Comments
Post a Comment