Create Intent to share Image - Android Graphics

Android examples for Graphics:Image Intent

Description

Create Intent to share Image

Demo Code


//package com.java2s;

import android.content.Context;
import android.content.Intent;

public class Main {
    public static void share(String wish, Context context) {
        Intent sendIntent = new Intent(Intent.ACTION_SEND);
        sendIntent.setAction(Intent.ACTION_SEND);
        sendIntent.putExtra(Intent.EXTRA_TEXT, wish);
        sendIntent.setType("text/plain");
        context.startActivity(Intent.createChooser(sendIntent,
                "Share image using"));
    }// ww  w . j  av a 2 s . co  m
}

Related Tutorials