Solve the crash problem of Android app on Samsung 5.0/5.1 model

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.