get Android Image Share Intent - Android Intent

Android examples for Intent:Image Share

Description

get Android Image Share Intent

Demo Code


//package com.java2s;

import android.content.Intent;

import android.net.Uri;

public class Main {
    public static Intent getAndroidImageShareIntent(
            CharSequence chooseTitle, String pathfile) {
        Intent share = new Intent(Intent.ACTION_SEND);
        share.setType("image/*");
        share.putExtra(Intent.EXTRA_STREAM, Uri.parse(pathfile));
        return Intent.createChooser(share, chooseTitle);
    }/*from  w  w w  .  j ava  2  s  .c  om*/
}

Related Tutorials