LinearLayout llQRCodeShare;
try {
llQRCodeShare.setDrawingCacheEnabled(true);
llQRCodeShare.buildDrawingCache(true);
Bitmap b = llQRCodeShare.getDrawingCache();
Bitmap bitmap = Bitmap.createBitmap(b);
llQRCodeShare.setDrawingCacheEnabled(false);
} catch (IllegalStateException e) {
LogUtil.e(TAG, e.getMessage()); //Software rendering doesn't support hardware bitmap
}
when execute the code"llQRCodeShare.getDrawingCache()"
,throws the exception,
Software rendering doesn't support hardware bitmap
on the android8.0.
How to solve it?
disable hardware acceleration either for the whole Activity
:
android:hardwareAccelerated="false"
or for that one particular View
:
llQRCodeShare.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
just make the android:hardwareAccelerated="true"
in the AndroidManifest.xml
under Application
tag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With