ActionBarSherlock is an extension of the compatibility library designed to facilitate the use of the action bar design pattern across all versions of Android with a single API.
The library will automatically use the native action bar when appropriate or will automatically wrap a custom implementation around your layouts. This allows you to easily develop an application with an action bar for every version of Android from 2.x and up.
This sample is simply the 'API Demos' sample from the Android support library ported to use SherlockFragmentActivity and SherlockFragment. It should provide a good idea of how these two classes are used to replace FragmentActivity and Fragment.
PERMISSIONS: Both the "Read contact" and "Internet" permissions are used for demonstration purposes only. These permissions are present in the official compatibility library sample and thus this sample. The app is open source and does not make any attempt to steal any private information.
Please DO NOT report bugs in reviews. Create an issue on the GitHub project or send them to my email directly. More information available via the website.
If you're new to Android programming or simply looking for a refresher on how to use tabs and fragments together to create a user interface, this application is probably worth checking out. It's incredibly simple and there's no shiny bells and whistles added to the application. The user interface is comprised of two tabs that you can switch between and the content within each tab is changed when you press the tabs.
Instructions for how to create a similar tabbed user interface are available at http://devleader.ca/2013/11/04/fragments-tabbed-android-user-interface/. You can also get to the corresponding tutorial article by using the application.
You can switch between pages and navigate without lose the fragment state. Also, by pressing back button you are able to return to previous fragment.
The source code will be available at:
Feel free to use it in your own projects.
For suggestions, improvements or doubts please contact me through @dani_lao or @pineappslab Twitter accounts.
More from developer
This app renders a Fragment into an Activity. The Fragment contains a button that shows a Toast when clicked.
It is a very basic app that loads the last 50 tweets that contain the word Android when it starts. It does nothing else. It is meant as a learning aid for Android developers. All source code is available here: https://github.com/posco2k8/rest_loader_tutorial.
It is a very basic app that loads the last 50 tweets that contain the word Android when it starts. It does nothing else. It is meant as a learning aid for Android developers. All source code is available here: https://github.com/posco2k8/rest_service_tutorial.