Headertab

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Wednesday, 11 March 2015

Share content on social network

 Intent share = new Intent(Intent.ACTION_SEND);

        // If you want to share a png image only, you can do:
        // setType("image/png"); OR for jpeg: setType("image/jpeg");

        share.setType("image/*");

// if you share video you can use
//   shareType("Video/*);

        // Make sure you put example png image named myImage.png in your
        // directory
        String image = Environment.getExternalStorageDirectory()
                + "/myImage.png";

        File imageToShare = new File(image);

        Uri uri = Uri.fromFile(imageToShare);
        share.putExtra(Intent.EXTRA_STREAM, uri);

        startActivity(Intent.createChooser(share, "Share Image!"));