android – Software rendering doesn't support hardware bitmap in Oreo-ThrowExceptions

Exception or error:
LinearLayout llQRCodeShare;
try {
    Bitmap b = llQRCodeShare.getDrawingCache();
    Bitmap bitmap = Bitmap.createBitmap(b);
} 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?

How to solve:

disable hardware acceleration either for the whole Activity:


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


In your Manifest add this android:supportsRtl = "true" under the application section.

Leave a Reply

Your email address will not be published. Required fields are marked *