If your Android app crashes when it's used on a Samsung 5.0/5.1 model, but is normal when used on other branded phones, check this file:
App/src/main/res/vales/styles.xml:
Look at this line <style name= "Yourprojecttheme" parent= "...", check if your code is similar to this (starting with Base.themeoverlay):
<style name= "Yourprojecttheme" parent= "Base.ThemeOverlay.AppCompat.Light" >
Samsung 5.0/5.1 model will be because base.themeoverlay ... This type of theme crashes.
Using the anroid system theme, you can solve this problem, such as:
<style name= "Yourprojecttheme" parent= "@android: Style/theme.holo.light" >
This problem is very difficult to find, because Android Studio cannot locate this error, but instead makes an error in the other code, and the errors are:
"Android.view.InflateException:Binary XML file Line #7"
Or
Crash at Com.android.internal.widget.ActionBarContextView
None of this has anything to do with the real mistake.
I ([email protected]) took nearly four days to find this problem in a very large project.
The use of Google, Bing, Baidu, have not found anything valuable. Maybe I was the first one to meet this problem?
Because this problem is difficult to find find, so, wrote this article, hoping to help others.
Original Address http://www.cnblogs.com/alex9xu/p/4958412.html welcome reprint, reproduced please indicate the source
Solve the crash problem of Android app on Samsung 5.0/5.1 model