android - Embedding Cordova WebView call native method -
i have added embedding cordova webview in native radio stream player app, , thats works perfekt.
but want change native view (viewflipper) javascript calling native function, how can this? ..
please help, have googled hours now!
finaly got work!!!
i had make cordova plugin, , call native function way...
@override public boolean execute(string action, jsonarray args, final callbackcontext callbackcontext) throws jsonexception { if (action.equals("radio")) { cordova.getactivity().runonuithread(new runnable() { public void run() { // button click //cordova.getactivity().findviewbyid(r.id.playbutton).performclick(); // method call ((radioapp) cordova.getactivity()).setviewflipper(0); ((radioapp) cordova.getactivity()).startstream(); // todo: not in use yet! callbackcontext.success(); // thread-safe. } }); return true; } return false; }
Comments
Post a Comment