与webview共享whatsapp

时间:2017-10-24 21:51:10

标签: android webview whatsapp

我有一个问题而且我从不使用Android Sudio,有人可以帮我解决该代码吗?

package de.httpmh_grafikdesign_frankfurt.datumrechner;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {

    WebView wv;
    public void onBackPressed(){
        if (wv.canGoBack()){
            wv.goBack();
        }else{
            super.onBackPressed();
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        wv = (WebView) findViewById(R.id.wv);
        wv.getSettings().setJavaScriptEnabled(true);
        wv.setFocusable(true);
        wv.setFocusableInTouchMode(true);
        wv.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
        wv.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        wv.getSettings().setDomStorageEnabled(true);
        wv.getSettings().setDatabaseEnabled(true);
        wv.getSettings().setAppCacheEnabled(true);
        wv.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        wv.loadUrl("www.http://mh-grafikdesign-frankfurt.de/rechner/rechner.php");
        wv.setWebViewClient(new WebViewClient());


    }

}

我在Webview中拥有自己的网站,我的问题是来自whatsapp的发送按钮...如何在webview中使用它?

net::ERR_UNKNOWN_URL_SCHEME 

1 个答案:

答案 0 :(得分:0)

此:

wv.loadUrl("www.http://mh-grafikdesign-frankfurt.de/rechner/rechner.php");

应该是这样的:

wv.loadUrl("http://www.mh-grafikdesign-frankfurt.de/rechner/rechner.php");