我不知道这个错误.
我从Google开发人员控制台获得了这些消息.
z3,htc m8和m9等某些设备无法执行我的应用.有人可以给我一些有关该错误的提示吗?
堆栈跟踪 :
java.lang.RuntimeException: Unable to start activity ComponentInfo{package name/package name.SettingsActivity}: androID.vIEw.InflateException: Binary XML file line #31: Error inflating class com.androID.internal.Widget.ActionbarContainer at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2499) at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2563) at androID.app.ActivityThread.access0(ActivityThread.java:162) at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1438) at androID.os.Handler.dispatchMessage(Handler.java:106) at androID.os.Looper.loop(Looper.java:209) at androID.app.ActivityThread.main(ActivityThread.java:5900) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1005) at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:800) Caused by: androID.vIEw.InflateException: Binary XML file line #31: Error inflating class com.androID.internal.Widget.ActionbarContainer at androID.vIEw.LayoutInflater.createVIEw(LayoutInflater.java:633) at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:743) at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:806) at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:504) at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:414) at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:365) at com.androID.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:3659) at com.androID.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3755) at com.androID.internal.policy.impl.PhoneWindow.setContentVIEw(PhoneWindow.java:403) at androID.app.Activity.setContentVIEw(Activity.java:2174) at androID.preference.PreferenceActivity.onCreate(PreferenceActivity.java:553) at pavkage name.SettingsActivity.onCreate(UnkNown Source) at androID.app.Activity.performCreate(Activity.java:5981) at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1124) at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2452) ... 10 more Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at androID.vIEw.LayoutInflater.createVIEw(LayoutInflater.java:607) ... 24 more Caused by: java.lang.RuntimeException: Failed to resolve attribute at index 13 at androID.content.res.TypedArray.getDrawable(TypedArray.java:747) at androID.vIEw.VIEw.<init>(VIEw.java:3785) at androID.vIEw.VIEwGroup.<init>(VIEwGroup.java:513) at androID.Widget.FrameLayout.<init>(FrameLayout.java:128) at androID.Widget.FrameLayout.<init>(FrameLayout.java:124) at androID.Widget.FrameLayout.<init>(FrameLayout.java:119) at com.androID.internal.Widget.ActionbarContainer.<init>(ActionbarContainer.java:61) ... 27 more
styles.xml
<!-- Base application theme. --><style name="Apptheme" parent="theme.AppCompat.light.DarkActionbar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item></style><style name="Apptheme.NoActionbar"> <item name="windowActionbar">true</item> <item name="windowNoTitle">true</item></style><style name="Apptheme.AppbarOverlay" parent="themeOverlay.AppCompat.Dark.Actionbar"/><style name="Apptheme.PopupOverlay" parent="themeOverlay.AppCompat.light"/>
AndroIDManifest.xml中
<application androID:allowBackup="true" androID:icon="@mipmap/ic_launcher" androID:label="@string/app_name" androID:supportsRtl="true" androID:theme="@style/Apptheme"> <activity androID:name="package name.SettingsActivity" androID:label="@string/app_name" androID:launchMode="singleTask" androID:theme="@style/Apptheme.AppbarOverlay"> <intent-filter> <action androID:name="androID.intent.action.MAIN"/> <category androID:name="androID.intent.category.LAUNCHER"/> </intent-filter> <intent-filter> <action androID:name="androID.intent.action.MANAGE_NETWORK_USAGE" /> <category androID:name="androID.intent.category.DEFAulT" /> </intent-filter> </activity>
XML
<PreferenceScreen xmlns:androID="http://schemas.androID.com/apk/res/androID"> <Preferencecategory androID:title="@string/pref_general_category"> <SeekbarPreference androID:defaultValue="10" androID:key="@string/PrefresetWhistleIntervalKey" androID:summary="@string/pref_reset_whistle_interval" androID:title="@string/pref_Title_reset_whistle_interval"/> <SeekbarPreference androID:defaultValue="10" androID:key="@string/PrefWhistleAmountKey" androID:summary="@string/pref_whistle_count" androID:title="@string/pref_Title_whistle_count"/> <SeekbarPreference androID:key="@string/PrefVolumeKey" androID:summary="@string/pref_alarm_volume" androID:title="@string/pref_Title_alarm_volume"/> <SwitchPreference androID:defaultValue="false" androID:key="@string/PrefMediaPlayerLoopKey" androID:summary="@string/pref_mediaplay_loop" androID:title="@string/pref_Title_mediaplay_loop"/> <Preference androID:clickable="false" androID:editable="false" androID:enabled="true" androID:key="@string/PrefChooseAudioKey" androID:selectable="true" androID:summary="" androID:title="@string/pref_Title_choose_media"/> </Preferencecategory> <Preferencecategory androID:title="@string/pref_battery_save_category"> <ListPreference androID:defaultValue="@string/pref_sensitivity_default_value" androID:dialogtitle="@string/pref_Title_sensitivity" androID:entrIEs="@array/array_sensitivity_item" androID:entryValues="@array/array_sensitivity_value" androID:key="@string/PrefSensitivityKey" androID:summary="@string/pref_sensitivity" androID:title="@string/pref_Title_sensitivity"/> </Preferencecategory> <Preferencecategory androID:title="@string/pref_system_category"> <SwitchPreference androID:defaultValue="true" androID:key="@string/PrefEnableServiceKey" androID:summary="@string/pref_service_on_off" androID:title="@string/pref_Title_service_on_off"/> <SwitchPreference androID:defaultValue="true" androID:key="@string/PrefEnableBootServiceKey" androID:summary="@string/pref_start_service_ono_ff" androID:title="@string/pref_Title_start_service_on_off"/> </Preferencecategory> <Preferencecategory androID:title="@string/testMode"> <Preference androID:clickable="false" androID:editable="false" androID:enabled="true" androID:key="@string/PrefTestModeKey" androID:selectable="true" androID:summary="@string/pref_test_mode" androID:title="@string/pref_Title_test_mode"/> </Preferencecategory></PreferenceScreen>
seekbarpreference来自
http://robobunny.com/blog_files/android_seekbar_preference/SeekBarPreference.java
解决方法:
我有同样的错误,这就是我的处理方式.
在styles.xml文件中,在第一个“ Apptheme”样式中,将Base放在theme.AppCompat的前面.因此它将是“ Base.theme.AppCompat.light.DarkActionbar”.
此后,转到“ AndroIDManifest”,在活动中不要使用“ AppbarOverlay”.因此,它将只是“ androID:theme =“ @ style / Apptheme”.
此外,在“ AndroIDManifest”中,从活动名称中删除“程序包名称”,而只需使用“ .SettingsActivity”.
如果您还有其他活动,则无需在每个活动中定义Apptheme,只需使用androID:parentActivityname =“.SettingsActivity”.
我知道您想要一个 *** 作栏,删除AppbarOverlay可能会有所帮助.
让我知道它是否有效.
以上是内存溢出为你收集整理的(活动preferencefragment)膨胀类com.android.internal.widget.ActionBarContainer的错误全部内容,希望文章能够帮你解决(活动preferencefragment)膨胀类com.android.internal.widget.ActionBarContainer的错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)