问题
So, I acknowledge that this is a truly vague question. What happens is that very randomly and rarely on only Samsung devices (2x S3 and 1xS4 mini) the starting activity (basically any activity, I have not found common ground) won't render and shows only a white screen. The funny thing is that actually the views are there, I can click the white screen and when I hit the correct spots, I can open dialogs using buttons, and go to the next activities. What is more weird is the fact that when the next activity opens using an animation, I can see the activity for a fraction of a second.
So, has anyone ever seen or experienced this?
Note: As this is such a random bug, I would need to copy the whole project here for code samples and I just cannot do that.
回答1:
It is known to Google that there is a problem with appcompat on various devices, such as
(~100 users):
- 50% Enspert (Rainbow, likely the Wiko model #8 mentioned)
- 30% Samsung (SM G3815, SM G730A, SM T217A, GT S7275B, GT S7275R)
- 10% MyPhone (Agua Rio)
The thread says (on Feb 8th)
This is potentially 'fixed' by an AOSP commit which will be in the next release: https://android-review.googlesource.com/#/c/198301/
See also the github issue where it is said
Various Samsung phones are including older versions of the android support library in the framework or classpath.
For a possible workaround, see appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2, where the proposed solutions are
using
-keep class !android.support.v7.internal.view.menu.**,android.support.v7.** {*;}
and
The better solution is add the following lines instead:
-keep class !android.support.v7.internal.view.menu.MenuBuilder, !android.support.v7.internal.view.menu.SubMenuBuilder, android.support.v7.** { *; } -keep interface android.support.v7.** { *; }
Update: seems like it's fixed in the android 7.0 appcompat library (SDK 24.0)
According to the last posts of the bug-report, this should be fixed on the new version of the support library (24) : https://code.google.com/p/android/issues/detail?id=78377#c374
Someone even claimed it fixed it.
来源:https://stackoverflow.com/questions/34926995/activity-wont-render-randomly-shows-only-white-screen-on-samsung