WP Ajaxify Comments
[resolved] Plugin crashes Android's WebView? (7 posts)

  1. jgadsby
    Posted 3 years ago #

    Hi there,

    First of all, love the plugin - makes the commenting experience much slicker. It also works fine on Android's own web browser.

    The problem is, it crashes WebView right as the green 'comment posted' message appears. It crashes my app with a 'null pointer exception'. Any ideas at all?



  2. janjonas
    Plugin Author

    Posted 3 years ago #


    thanks for your comment. Do you have any further information about the error ? Is it a client side (JavaScript) error or an application (Java) error? Something like a StackTrace, line of code where the error occurred would be helpful to find the cause.
    Have you tried to disable the WP-Ajaxify-Comments plugin to make sure that the error is caused by the plugin?

    Hope this helps...

  3. jgadsby
    Posted 3 years ago #

    I've tried disabling the plugin and the site works normally - comments go through fine on the app. Here's the (java?) error I see when the app crashes:

    04-20 17:04:49.588: D/WebView(29814): onSizeChanged - w:480 h:762
    04-20 17:04:51.743: I/GATE(29814): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
    04-20 17:04:51.743: D/AndroidRuntime(29814): Shutting down VM
    04-20 17:04:51.743: W/dalvikvm(29814): threadid=1: thread exiting with uncaught exception (group=0x40fdc2a0)
    04-20 17:04:51.938: E/AndroidRuntime(29814): FATAL EXCEPTION: main
    04-20 17:04:51.938: E/AndroidRuntime(29814): java.lang.NullPointerException
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at com.shuffleelffuhs.shufflemylife.MainActivity$WebClientClass.onPageFinished(MainActivity.java:110)
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java)
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at android.os.Handler.dispatchMessage(Handler.java)
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at android.os.Looper.loop(Looper.java)
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at android.app.ActivityThread.main(ActivityThread.java)
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at java.lang.reflect.Method.invokeNative(Native Method)
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at java.lang.reflect.Method.invoke(Method.java:511)
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
    04-20 17:04:51.938: E/AndroidRuntime(29814): 	at dalvik.system.NativeStart.main(Native Method)
  4. jgadsby
    Posted 3 years ago #

    The specific code in the app that seems to be breaking:

      public void onPageFinished(WebView view, String url) {
       super.onPageFinished(view, url);
       pd = null;

    This code basically just dismisses a 'loading' popup in the app once a page has finished loading. I suppose there's some bug here because the comments code isn't technically reloading the page? I'm not sure.

    Also note that there are other AJAX elements being used on the site but these don't seem to crash?

  5. janjonas
    Plugin Author

    Posted 3 years ago #

    I don't know the internals of your Android application, but you may have to check if pd is (already) null before calling dismiss() in the onPageFinished method.

  6. janjonas
    Plugin Author

    Posted 3 years ago #

    Problem seems to be fixed. Please feel free to reopen the thread if you need further assistance...

  7. janjonas
    Plugin Author

    Posted 3 years ago #


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Ajaxify Comments
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic