Android Intent send text

Description

Android Intent send text



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

public class Main {
    public static void main(String[] argv) throws Exception {
    }/*from www  .j a v  a 2  s.  c om*/

    public static void SendTo(Context ctx, String sendWhat) {
        Intent shareIntent = new Intent(Intent.ACTION_SEND);
        shareIntent.setType("text/plain");
        shareIntent.putExtra(Intent.EXTRA_TEXT, sendWhat);
        ctx.startActivity(shareIntent);
    }
}



PreviousNext

Related