On Thu, Mar 24, 2011 at 6:24 PM, Brion Emde <[email protected]> wrote:
> In this example, the application requires a minimum version of API
> Level 4 (Android 1.6), but it also targets API Level 11 (Android 3.0).
> This way, when the application is installed on a device running
> Android 3.0 or greater, the system applies the holographic theme to
> each activity, and thus, each activity includes the Action Bar.
>
> However, if you want to use Action Bar APIs, such as to add tabs or
> modify Action Bar styles, you need to set the android:minSdkVersion to
> "11", so you can access the ActionBar class.

Generally speaking, this is incorrect, AFAICT. The action bar is no
different than anything else in Android.

> I'm having an argument with my boss, who thinks that since it "works"
> on Honeycomb, that the above excerpt does not apply to us. But I point
> out that when I comment out the code that tries to talk to the action
> bar directly, then I don't get Verify Errors on pre-Honeycomb devices.
> Everything used to work fine before we started trying to talk to the
> Action Bar directly.

Perhaps you need to try another backwards-compatibility approach. Here
is a sample project that uses getActionView() -- an HC-only action
bar-related method -- successfully on HC and works correctly on
earlier Android versions:

https://github.com/commonsguy/cw-android/tree/master/Menus/ActionBarBC

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.5 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to