get Android Share Intent - Android Intent

Android examples for Intent:Image Share

Description

get Android Share Intent

Demo Code


//package com.java2s;

import android.content.Intent;

public class Main {
    public static Intent getAndroidShareIntent(CharSequence chooseTitle,
            CharSequence subject, CharSequence content) {
        Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
        shareIntent.setType("text/plain");
        shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
        shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, content);
        return Intent.createChooser(shareIntent, chooseTitle);
    }//from w w w . jav  a 2 s  .c  o  m
}

Related Tutorials