Ejemplo n.º 1
0
 @Kroll.method
 public Object evalJS(String code) {
   // If the view doesn't even exist yet,
   // or if it once did exist but doesn't anymore
   // (like if the proxy was removed from a parent),
   // we absolutely should not try to get a JS value
   // from it.
   TiUIWebView view = (TiUIWebView) peekView();
   if (view == null) {
     Log.w(TAG, "WebView not available, returning null for evalJS result.");
     return null;
   }
   return view.getJSValue(code);
 }