This is not really a huge issue, as my project still builds and runs correctly (using gradle), but I'm having trouble getting Android Studio to recognize the application compatibility theme released in the API 18 SDK (for allowing actionbar support for android 2.1 and above).
I have the support libraries loading successfully, because code completion is possible for the ActionBar classes in java files. The issue is that Android studio shows red text errors for assignments to the Theme.AppCompat.Light in the AndroidManifest.xml.
Is there a way to enable code completion for theme resources declared in the manifest from external libraries in Android Studio?
Updated Here is my <activity>
block from my AndroidManifest:
<activity
android:name="com.example.activities.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light" >
I've also tried setting the theme in the application block:
<application
android:allowBackup="true"
android:icon="@drawable/main_final_ic"
android:label="@string/app_name"
android:logo="@drawable/main_final_enzo"
android:theme="@style/Theme.AppCompat.Light" >
Again, these both work and compile OK, but appear as red text with errors in my IDE. I've also just confirmed that the same issues are occurring when running my project in eclipse.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…