webview on android - whatsapp share
<p>i have webview show my site.
in my site i have share to whatsapp.
in mobile broweser it work well- in webview it get eror</p>

<p>whatsapp://send?text=..my url
and..
net::ERR_UNKNOW_URL_SCHEME</p>

<p>please help me..i try many ways and cannt fix it</p>

<p>this my code:</p>

<pre><code>package info.demo.demo.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.List;

import info.ballerina.ballerina.R;
import info.ballerina.ballerina.helper.ParseUtils;
import info.ballerina.ballerina.helper.PrefManager;
import info.ballerina.ballerina.model.Message;


public class MainActivity extends AppCompatActivity {

    private static String TAG = MainActivity.class.getSimpleName();

    // private Toolbar mToolbar;
    private ListView listView;
    private List&lt;Message&gt; listMessages = new ArrayList&lt;&gt;();
    private MessageAdapter adapter;
    private PrefManager pref;
    WebView webview;
    ProgressBar loadingProgressBar, loadingTitle;
    ImageView logo;
    int first = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // getWindow().requestFeature(Window.FEATURE_PROGRESS);
        //getWindow().getDecorView().setSystemUiVisibility(0x10);
        setContentView(R.layout.activity_main);
        loadingProgressBar = (ProgressBar) findViewById(R.id.progressbar_Horizontal);
        logo = (ImageView) findViewById(R.id.imglogo);

        webview = (WebView) findViewById(R.id.webview);
        webview.getSettings().setJavaScriptEnabled(true);
        final Activity activity = this;
        webview.setWebChromeClient(new WebChromeClient() {
            public void onProgressChanged(WebView view, int progress) {
                // Activities and WebViews measure progress with different scales.
                // The progress meter will automatically disappear when we reach 100%
                loadingProgressBar.setProgress(progress);
                //loadingTitle.setProgress(newProgress);
                // hide the progress bar if the loading is complete

                if (progress == 100) {
                    loadingProgressBar.setVisibility(View.GONE);

                    logo.setVisibility(ImageView.GONE);

                    webview.setVisibility(WebView.VISIBLE);
                    first = 1;


                } else {
                    loadingProgressBar.setVisibility(View.VISIBLE);

                    if (first == 0) {
                        webview.setVisibility(WebView.GONE);
                        logo.setVisibility(ImageView.VISIBLE);
                    } else if (first == 1) {
                        logo.setVisibility(ImageView.GONE);
                    }

                }
            }
        });
        webview.setWebViewClient(new WebViewClient() {
            public void onReceivedError(WebView view, int errorCode, String description, String
                    failingUrl) {
                Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show();
            }
        });
        webview.loadUrl("http://www.demo.com/");


        listView = (ListView) findViewById(R.id.list_view);
       /* mToolbar = (Toolbar) findViewById(R.id.toolbar);

        setSupportActionBar(mToolbar);
        getSupportActionBar().setDisplayShowHomeEnabled(true);*/

        adapter = new MessageAdapter(this);
        pref = new PrefManager(getApplicationContext());

        listView.setAdapter(adapter);

        Intent intent = getIntent();

        String email = pref.getEmail();

        if (email != null) {
            ParseUtils.subscribeWithEmail(pref.getEmail());
        } else {
            Log.e(TAG, "Email is null. Not subscribing to parse!");
        }
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        String message = intent.getStringExtra("message");

        Message m = new Message(message, System.currentTimeMillis());
        listMessages.add(0, m);
        adapter.notifyDataSetChanged();
    }

    private class MessageAdapter extends BaseAdapter {

        LayoutInflater inflater;

        public MessageAdapter(Activity activity) {
            inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        }

        @Override
        public int getCount() {
            return listMessages.size();
        }

        @Override
        public Object getItem(int position) {
            return listMessages.get(position);
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View view = convertView;
            if (view == null) {
                view = inflater.inflate(R.layout.list_row, null);
            }

            TextView txtMessage = (TextView) view.findViewById(R.id.message);
            TextView txtTimestamp = (TextView) view.findViewById(R.id.timestamp);

            Message message = listMessages.get(position);
            txtMessage.setText(message.getMessage());

            CharSequence ago = DateUtils.getRelativeTimeSpanString(message.getTimestamp(), System.currentTimeMillis(),
                    0L, DateUtils.FORMAT_ABBREV_ALL);

            txtTimestamp.setText(String.valueOf(ago));

            return view;
        }
    }


    @Override
    public void onBackPressed() {
        if (webview.canGoBack()) {
            webview.goBack();
        } else {
            super.onBackPressed();
        }
    }
}
</code></pre>