share Images via Intent - Android Intent

Android examples for Intent:Image Share

Description

share Images via Intent

Demo Code


//package com.java2s;

import android.app.Activity;
import android.content.Intent;

import android.net.Uri;

public class Main {
    public static void shareImages(Activity activity, String imagePath) {
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("image/png");
        intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(imagePath));
        activity.startActivity(intent);/*from   w  w w .j a  va  2s  .  c  o m*/
    }
}

Related Tutorials