Follow the steps mentioned for using support ActionBar in Android Studio(0.4.2) :
Download the Android Support Repository from Android SDK Manager, SDK Manager icon will be available on Android Studio tool bar (or Tools -> Android -> SDK Manager
).
After download you will find your Support repository here
$SDK_DIRextrasandroidm2repositorycomandroidsupportappcompat-v7
Open your main module's build.gradle file and add following dependency for using action bar in lower API level
dependencies {
compile 'com.android.support:appcompat-v7:+'
}
Sync your project with gradle using the tiny Gradle icon available in toolbar (or Tools -> Android -> Sync Project With Gradle Files
).
There is some issue going on with Android Studio 0.4.2 so check this as well if you face any issue while importing classes in code.
Import Google Play Services library in Android Studio
If Required follow the steps as well :
- Exit Android Studio
- Delete all the .iml files and files inside .idea folder from your
project
- Relaunch Android Studio and wait till the project synced completely
with gradle. If it shows an error in Event Log with import option click on Import Project.
This is bug in Android Studio 0.4.2 and fixed for Android Studio 0.4.3 release.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…