D
Deleted member 103
Guest
Hi,
in Crashlytics always comes back this crash report:
The crash always happens at the procedure:
Of course all resources are available under ".. \ Objects \ res \ drawable".
As always, the crash does not happen with all devices, so it is difficult to make the mistake reproducible.
My question is now: can one change this procedure so that one no longer uses the library "Reflector"?
in Crashlytics always comes back this crash report:
Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x12e40030
at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:225)
at android.content.res.Resources.getDrawableForDensity(Resources.java:890)
at android.content.res.Resources.getDrawable(Resources.java:833)
at android.content.res.Resources.getDrawable(Resources.java:808)
at java.lang.reflect.Method.invoke(Method.java)
at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:216)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod2(Reflection.java:817)
at fg.test1.clskeyboard._vvvvvvvvvvvvvvvvvvvvvvv5(clskeyboard.java:487)
at fg.test1.clskeyboard._vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv3(clskeyboard.java:380)
at fg.test1.clskeyboard._initialize(clskeyboard.java:345)
at fg.test1.main._activity_create(main.java:580)
at java.lang.reflect.Method.invoke(Method.java)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at fg.test1.main.afterFirstLayout(main.java:104)
at fg.test1.main.access$000(main.java:17)
at fg.test1.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
The crash always happens at the procedure:
B4X:
Private Sub SetNinePatchButton(Btn As Button, DefaultImage As String, PressedImage As String)
Dim r As Reflector
Dim package As String
Dim idDefault, idPressed As Int
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")
idDefault = r.GetStaticField(package & ".R$drawable", DefaultImage)
idPressed = r.GetStaticField(package & ".R$drawable", PressedImage)
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
Dim sd As StateListDrawable
sd.Initialize
sd.AddState(sd.State_Pressed, r.RunMethod2("getDrawable", idPressed, "java.lang.int"))
sd.AddCatchAllState( r.RunMethod2("getDrawable", idDefault, "java.lang.int"))
Btn.Background = sd
End Sub
Of course all resources are available under ".. \ Objects \ res \ drawable".
As always, the crash does not happen with all devices, so it is difficult to make the mistake reproducible.
My question is now: can one change this procedure so that one no longer uses the library "Reflector"?
Last edited by a moderator: