Because it takes me a lot of time to integrate the Sherlock Action Bar in my Android project (with its map plugin !), I propose to depict here my solution.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
First step consists to create a library project, second to create your own project that will use the Action Bar and third step enables to use the map plugin.
I - ActionBar SHerlock project :
- download the actionbarSherlock zip file
- import existing Android code into Workspace (for ActionBar 4.2.0). select the directory "library" to import. A "library" project is created.
- set your manifest with "android:minSdkVersion="7" android:targetSdkVersion="16"
- Import compatibility library: right click on the project > Android Tools > Add Support Library
configure this project with the following Project properties :
- android build target : >= android 4.0
- check "Is Library"
II - Your project :
- create your project that use Action Bar sherlock
- set Android Build Target to >= Android 4.0 (choose the same target than the previous project !)
- set your manifest with "android:minSdkVersion="7" android:targetSdkVersion="16"
- add the previous project "ActionBarSherlock" as a library : Project > Properties > Android > Add... (bottom panel)
- Change your code to use the ActionBar classes
III - To use the actionbarsherlock-plugin-maps-4.1.0.jar plugin of Action Bar Sherlock :
- add the actionbarsherlock-plugin-maps-4.1.0.jar (obtained from the zip file) to the project "ActionBarSherlock" in the libs directory
configure the project : project > properties > build path > Librairies :
- add actionbarsherlock-plugin-maps-4.1.0.jar
set the build target to Google map API >4.0 (do the same for your project - same target !)
- add the "actionbarsherlock-plugin-maps-4.1.0.jar" library to the new project’s build path
I Hope it will also work for you.