open Feedback Chooser - Android Intent

Android examples for Intent:Send Email

Description

open Feedback Chooser

Demo Code


//package com.java2s;
import android.content.Context;
import android.content.Intent;

import android.net.MailTo;

public class Main {
    public static void openFeedbackChooser(Context context, final String url) {
        if (url.startsWith("mailto:")) {
            MailTo mt = MailTo.parse(url);
            Intent emailIntent = new Intent(
                    android.content.Intent.ACTION_SEND);
            emailIntent.setType("message/rfc822");// it will open only
            emailIntent.putExtra(Intent.EXTRA_EMAIL,
                    new String[] { mt.getTo() });
            emailIntent.putExtra(Intent.EXTRA_SUBJECT,
                    "Simpliti Analytics Feedback/Support");
            context.startActivity(Intent.createChooser(emailIntent,
                    "Simpliti Analytics Support"));
        }/*  ww w . j av  a2  s  . co  m*/
    }
}

Related Tutorials