Android Question Receiving Error From Webview

HimeAnator

Member
Licensed User
Longtime User
My app uses a webview as a photo viewer and I enable and disable the zoom ability at certain times. However today I started receiving this error from the market place. Does anyone have any ideas how I can fix this?

B4X:
java.lang.IllegalArgumentException: Receiver not registered: android.widget.ZoomButtonsController$1@440cb690
at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:719)
at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1628)
at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:445)
at android.widget.ZoomButtonsController.setVisible(ZoomButtonsController.java:405)
at android.widget.ZoomButtonsController$2.handleMessage(ZoomButtonsController.java:179)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:5751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
at dalvik.system.NativeStart.main(Native Method)
 

HimeAnator

Member
Licensed User
Longtime User
Seems like it is related to this Android issue: http://code.google.com/p/android/issues/detail?id=15694

I will add the workaround suggested there in the next update.

Thank you Erel that's exactly the issue I'm experiencing.

Seems like the workaround is this...
B4X:
public class MyWebView extends WebView {

    public MyWebView(Context context, AttributeSet attr) {
        super(context, attr);
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        destroy();
    }
}

How could I translate this into B4a Code? I'm not sure if I could wait for an update since I have customers starting to complain.
 
Upvote 0
Top