简体   繁体   中英

how to use android-support-v7 ActionBar for version 2.2

I want to have actionbar in my Android Project using android.support.v7.appcompat; and use it in android 2.2 API Version 8.

I Installed Android support library from SDK Manager, and also added the android-support-v7-appcompat from /extras/android/Compatibility/v7/

but the current version of this project is 4.2 (the last version of SDK I have already downloaded). When I add this project as a reference to my project I get error (my resurce file (R) has error and couldn't use R.layout.main )

how can I solve my Problem and use support.v7 ActionBar?

if Change it to Android 4.2; I don't have problem

You are forcing us to have to guess what "it" is.

If "it" is your build target (eg, Project > Properties > Android in Eclipse), please set that to something like 4.2. This does not control what versions of Android your app runs on . Set your android:minSdkVersion to be 8 (for Android 2.2), as that is what controls what versions of Android your app runs on. Lint will tell you when you are using things that are legal for your build target, but newer than your android:minSdkVersion , so you can make sure that you are using those things appropriately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM