Skip to content Skip to sidebar Skip to footer

(activity+preferencefragment) Error Inflating Class Com.android.internal.widget.actionbarcontainer

I have no idea about this error. I got these mesaage from google developer console. Some devices like z3, htc m8 ,m9 can't execute my app. Could someone give me some hint about the

Solution 1:

I had the same error, and here is how I dealt with it. In the styles.xml file, in the first "AppTheme" style put Base infront of Theme.AppCompat. So it would be "Base.Theme.AppCompat.Light.DarkActionBar".

After this, go to your "AndroidManifest" and in your activity do not use "AppBarOverlay". So it would be just "android:theme="@style/AppTheme".

Furthermore, in "AndroidManifest" remove "package name" from your activity name, and just use ".SettingsActivity".

If you have other activities then instead of defining AppTheme in each activity, just use android:parentActivityName=".SettingsActivity."

I know you want to have an action bar and removing AppBarOverlay could help. Let me know if it works.

Solution 2:

extend class with AppCompatActivity instead of Activity it will give you the action bar

Post a Comment for "(activity+preferencefragment) Error Inflating Class Com.android.internal.widget.actionbarcontainer"