我无法在模拟器上运行我的应用程序,并在logcats上发现错误

时间:2017-03-05 16:27:42

标签: android colors runtimeexception

我想在模拟器上运行我的应用程序然后我无法打开它说不幸的是,MyApp已停止 我搜索谷歌,我被告知看看logcat,发现这个

Caused by: java.lang.RuntimeException: A TaskDescription's primary color should be opaque
                  at android.app.ActivityManager$TaskDescription.<init>(ActivityManager.java:586)
                  at android.app.Activity.onApplyThemeResource(Activity.java:3731)
                  at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java:150)
                  at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java:94)
                  at android.support.v7.app.AppCompatActivity.setTheme(AppCompatActivity.java:90)
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2362)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                  at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                  at android.os.Handler.dispatchMessage(Handler.java:102) 
                  at android.os.Looper.loop(Looper.java:148) 
                  at android.app.ActivityThread.main(ActivityThread.java:5417) 
                  at java.lang.reflect.Method.invoke(Native Method) 
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

这是我的colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="colorPrimary">#bb000000</color>
<color name="colorPrimaryDark">#d79d9f9f</color>
<color name="colorAccent">#FF4081</color>
<color name="colorMerah">#d79d9f9f</color>
<color name="a">#FFFFFF</color>
<color name="buttonColor">#bb000000</color>

</resources>

你的帮助对我来说意味着很多,请帮助我,这是我的第一个应用程序

1 个答案:

答案 0 :(得分:0)

在你的情况下,不能像xx0xxxxxx那样使用颜色值,colorPrimary和colorPrimaryDark。尝试使用实心的六位十六进制颜色,就像那里的colorAccent

一样