android - 谷歌地图通过网络视图的方向不起作用

时间:2012-02-16 13:15:00

标签: android webview

在我的应用程序中,我想使用url在webview中显示两个地理点之间的方向。 但是方向页面没有打开。为此,我需要任何权限或设置任何属性。请任何人帮助我。

打开以下页面。

enter image description here

Code

公共类RB_BusinessDirectionWebpage扩展Activity {

public WebView webview; 
protected ProgressDialog web_pd;
final Handler rb_web_pd_Handler = new Handler();        
@Override
public void onCreate(Bundle icicle) 
{
    super.onCreate(icicle); 

    //Removing the title
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.static_direction);            

    webview = (WebView)findViewById(R.id.wv_direction);  

    webview.getSettings().setJavaScriptEnabled(true);
    webview.getSettings().setPluginsEnabled(true);
    webview.getSettings().setDomStorageEnabled(true);
    webview.getSettings().setBuiltInZoomControls(true);
    webview.getSettings().setSupportZoom(true);
    webview.getSettings().setAllowFileAccess(true);
    webview.getSettings().setGeolocationEnabled(true);

    web_pd = ProgressDialog.show(RB_BusinessDirectionWebpage.this, "", "Please wait...", true);
    Thread t = new Thread() 
    {
        public void run() 
        {               
            rb_web_pd_Handler.post(checked_LoginResp);
        }                                               
    };
    t.start();


    String page_url = getIntent().getStringExtra("page_url");
    System.out.println("URL:"+page_url);       
    webview.loadUrl(page_url);      

}

 final Runnable checked_LoginResp = new Runnable()
 {
     public void run()
     {
         try
         {
             webview.setWebChromeClient(new WebChromeClient() 
             {
                 public void onProgressChanged(WebView view, int progress)
                 {
                     if(progress == 100)
                     {
                         web_pd.dismiss();  

                     }
                 }
             });
         } 
         catch(Exception e)
         {
             e.printStackTrace();
         }
     }      
 };                              }

0 个答案:

没有答案