Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. integrating google map api 3 and using javascript on android
  2. private void setupWebView(){
  3.   final String centerURL = "javascript:centerAt(" +
  4.   mostRecentLocation.getLatitude() + "," +
  5.   mostRecentLocation.getLongitude()+ ")";
  6.   webView = (WebView) findViewById(R.id.webview);
  7.   webView.getSettings().setJavaScriptEnabled(true);
  8.   //Wait for the page to load then send the location information
  9.   webView.setWebViewClient(new WebViewClient(){
  10.     @Override
  11.     public void onPageFinished(WebView view, String url){
  12.       webView.loadUrl(centerURL);
  13.     }
  14.   });
  15.   webView.loadUrl(MAP_URL);
  16. }