title: How to call JavaScript from webview in fragment?
body: <p>Below code, I am using to load webview in fragment and I want to call JavaScript function from webview but below code is not working. </p>
  
  <pre><code>public class MainActivity extends ActionBarActivity
  {
      public void loadUrlInWebView(String url,String positon)
          {
          WebViewFragment fragment =  new WebViewFragment();
          Bundle data = new Bundle();
          data.putString("url",url);
          fragment.setArguments(data);
          FragmentManager fragmentManager = getSupportFragmentManager();
          fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
          }
  
          var url ="javascript:mobileApp.openLoginMenu()";
              loadUrlInWebView(url,null);
  }
  
  public class WebViewFragment extends Fragment{
       public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
          {
          url = getArguments().getString("url");
          View rootView = inflater.inflate(R.layout.activity_main, container, false);
          webView = (WebView) rootView.findViewById(R.id.webView);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.addJavascriptInterface(new JsInterface(getActivity()),"AndroidJSObject");
          webView.loadUrl(url);
          webView.setWebViewClient(new WebViewClient()
          {
              public boolean shouldOverrideUrlLoading(WebView view, String url)
              {
              view.loadUrl(url);
              return true;
              }
          });
          return rootView;
          }
  }
  </code></pre>