2015-06-05 67 views
1

我使用AppCompatActivityAppCompat不支持當前的主題功能,android?

public class SplashActivity extends AppCompatActivity 

這是我的主題

<!-- Base application theme. --> 
<style name="AppTheme" parent="Theme.AppCompat"> 
    <!-- Customize your theme here. --> 
    <item name="android:windowNoTitle">true</item> 
    <item name="windowActionBar">false</item> 

</style> 

它拋出異常

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vfi/com.vfi.SplashActivity}: java.lang.IllegalArgumentException: AppCompat does not support the current theme features 
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2237) 
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286) 
     at android.app.ActivityThread.access$800(ActivityThread.java:145) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:136) 
     at android.app.ActivityThread.main(ActivityThread.java:5127) 
     at java.lang.reflect.Method.invokeNative(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:515) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641) 
     at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.IllegalArgumentException: AppCompat does not support the current theme features 
     at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:363) 
     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:246) 
     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106) 
     at com.vfi.SplashActivity.onCreate(SplashActivity.java:17) 
     at android.app.Activity.performCreate(Activity.java:5231) 
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2201) 

如何解決這個問題?

+0

父=「Theme.AppCompat.Light」使用此 –

+0

仍同一問題 – WISHY

+0

重複問題[here] [1] [1]:http://stackoverflow.com/questions/29784124/java-lang-illegalargumentexception-appcompat-does-not-suppo rt-the-current-theme – AndroidLad

回答

0

試試這個。

<style name="Theme.AppCompat.Light.NoActionBar" parent="@style/Theme.AppCompat.Light"> 
    <item name="android:windowNoTitle">true</item> 
    <item name="windowActionBar">false</item> 
    </style> 
+1

仍然是相同的問題 – WISHY

+0

我編輯了我的答案。爲我工作。試一試。 – Nitesh

+2

true我希望你應該刪除android:在windowNoTitle太 –

0

嘗試這樣便

1

我看穿了你的問題走訪時發現,這是不是在這裏唯一的問題重複的問題here

相關問題