Basically I would like to know if we can have fragment layouts in devices with Android OS < 3.0.
My app had a header on top with 5 different buttons and on start always the first button is clicked by default so the view below these buttons is for the first view. Now when you click on the second button beside it, I don’t want the header images to be refreshed but the view just below it needs to be refreshed. So its like updating the fragments below the header image buttons.
So can we have fragments in Android in devices with OS < 3.0.
Sana.
You have to use the compatibility libraries provided by Google. Here’s how you use Fragments on devices < 3.0
Once installed, right click the Android project you want to add Fragment support for.
Now you application supports Fragments. There are some key differences to using the compatibility package over using SDK 3.0+. For instance
FragmentActivityNOTActivity.getFragmentManager()you have to usegetSupportFragmentManagerEnjoy!!!