问题
I build my App with Android Lollipop SDK (21). After opening some activities and close they, one activity has this corrupted screen. It looks like a Memory error, but this happens only on Android Lollipop devices. In the Logcat i cant see errors.
Any ideas what this is?

回答1:
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); solves the problem.
回答2:
It should also happen on 4.4. Try to always assign a background to your fragment or activity. update Somebody did try using a transparent bkg and it didn't work.
回答3:
The solution
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
is OK, but a bit overkill since this issue only applies to Nexus devices on 5.0 Lollipop. Why punish all phone models?
boolean isLollipop = android.os.Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP;
boolean isNexus = android.os.Build.MODEL.toLowerCase().contains("nexus");
if (isLollipop && isNexus) {
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
This code assumes that Google will fix the problem in the next version of the OS.
Edit
As of 5.1 this has been fixed, which this code handles.
来源:https://stackoverflow.com/questions/27224394/android-lollipop-activity-screen-corrupted