diff --git a/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java b/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java index f5dac1fa60..22e2c7a85b 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java +++ b/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java @@ -787,7 +787,14 @@ public class ExtractStyle { private JSONObject findPatchesMarings(Drawable d) throws JSONException, NoSuchFieldException, IllegalAccessException { - NinePatch np = (NinePatch) getAccessibleField(NinePatchDrawable.class, "mNinePatch").get(d); + NinePatch np; + Field f = tryGetAccessibleField(NinePatchDrawable.class, "mNinePatch"); + if (f != null) { + np = (NinePatch) f.get(d); + } else { + Object state = getAccessibleField(NinePatchDrawable.class, "mNinePatchState").get(d); + np = (NinePatch) getAccessibleField(state.getClass(), "mNinePatch").get(state); + } if (Build.VERSION.SDK_INT < 19) return getJsonChunkInfo(extractChunkInfo((byte[]) getAccessibleField(np.getClass(), "mChunk").get(np))); else