I have developed an Android app that targets API 7. Now I want to add these tabs http://developer.android.com/training/implementing-navigation/lateral.html .
When trying to implement this I run into the problem that my app targets api 7 and that some action bar require a higher api. For example, one of my errors is
Call requires API level 14 (current min is 7): android.app.ActionBar#setHomeButtonEnabled
So now my question is: How can I work around this problem? What are my options?
I have heard of something like 'actionbar sherlock'. Would that help with my actionbar tabs? And if so, how do I add that library to my project?
Thanks!
I think you can use ActionBarSherlock. You have to target api 11 but you can set the min lower than that.
Targetting API level 11 or newer is required as it will cause Android to automatically add the native action bar when run on newer devices. Since you will be compiling against new APIs but your app will likely be run on devices with older versions of Android extra care must be taken to either avoid using or properly check and call any methods that were introduced after your minimum SDK version.
The instruction is here.
Also, ActionBarSherlock gives tons of "Call requires API level 11 (current min is 7)" errors might be helpful.