Open URL in WebView instead of default Browser

前端 未结 6 1885
不思量自难忘°
不思量自难忘° 2020-12-30 07:19

I am creating simple Webview application with some links on textview and open those links in webview instead of default browser. My

6条回答
  •  無奈伤痛
    2020-12-30 07:46

    Your Webview Application will receive Link when some link is clicked. User manually have to select your application. specifying host "like www.apptechinc.com" will launch this application when any link from that site is clicked.

        
        
            
            
        
        
            
            
            
            
            
        
        
    

    In Activity you can receive this link as :

        String action = getIntent().getAction();
        if (Intent.ACTION_VIEW.equals(action)) {
            Uri uri = getIntent().getData();
                webview.loadUrl(urlsetup(uri.getPath())); 
    
        } 
    

提交回复
热议问题