Android code for share url from webview

share URL to facebook from webview in android
share URL to twitter from webview in android
share URL to whatsup from webview in android
share URL to google+ from webview in android

I assigned ourSite variable to webview 

Use following code to share URL to social network

                    Intent shareIntent = new Intent(Intent.ACTION_SEND);
   shareIntent.setType("text/plain");
   shareIntent.putExtra(Intent.EXTRA_TEXT, ourSite.getUrl());
   startActivity(Intent.createChooser(shareIntent, "Share This!"));


It looks like below


Leave reply

Add your comments here

Back to Top