javascript - JavescriptInterface and thread not returning to main thread -


i'm developing app android , of content displayed via webview.

i have interface javascript this.

webappinterface(context c, response response) {         activity = (activity) c;         delegate = response;         context = c;     }      /** show toast web page */     @javascriptinterface     public void getresponse(final string operation, final string response, final string type) {         final handler mainhandler = new handler(context.getmainlooper());         mainhandler.post(new runnable() {             @override             public void run() {                 delegate.didgetresponse(operation, response, type);                 log.d("success: ", "im still here"); <-- why not in main thread?              }         });         }      public interface response {         public void didgetresponse(string operation, string response, string type);     } 

my activity implements didgetresponse , have switch executes code , update webview if needed on first function in webview after page set webview not respond anymore "clicks"

i'm thinking because thread still in javascriptinterface?

however native buttons can still update webview. want able call js functions newly loaded url in webview

okay, found answer turns out calling javascript function little arguments. solution worked , problem js function had 2 arguments instead of 3 on page. different swift did work 2 arguments.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -