Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Compatibility Package

Tags:

android

Trying to make the Fragments example work on lower than 11 SDK, I get an error in

setListAdapter(new ArrayAdapter<String>(getActivity(),
                    android.R.layout.simple_list_item_activated_1, Shakespeare.TITLES));

saying "simple_list_item_activated_1" cannot be resolved or is not a field". In import i have

import com.example.android.apis.R; 
import com.example.android.apis.Shakespeare;

What wrong is in here?

like image 236
lomza Avatar asked Oct 11 '22 13:10

lomza


1 Answers

That resource is new to API Level 11. If you want to use that resource on earlier versions of Android, copy it out of your SDK and into your project, then reference your project-local copy. Note that you may need to make other adjustments to this layout file, as I think it will refer to some new style attributes and such that do not exist in earlier versions of Android.

like image 183
CommonsWare Avatar answered Oct 19 '22 00:10

CommonsWare