Android Open Source - Helpers Intent Helper






From Project

Back to project page Helpers.

License

The source code is released under:

MIT License

If you think the Android project Helpers listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package at.wrdlbrnft.helpers;
//from  w  ww  . ja  v  a  2 s.  com
import android.content.Intent;
import android.net.Uri;

/**
 * Created by Xaver on 26/08/14.
 */
public class IntentHelper {

    private static final String PLAYSTORE_APP_URI_PREFIX = "market://details?id=";

    public static Intent openInPlaystore(String packageName) {
        final String url = String.format("%s%s", PLAYSTORE_APP_URI_PREFIX, packageName);
        return view(url);
    }

    public static Intent view(String url) {
        final Uri uri = Uri.parse(url);
        return new Intent(Intent.ACTION_VIEW, uri);
    }

    public static Intent mail(String address, String subject, String body) {
        String url = MailTo.PRE_FIX + address + "?" + MailTo.PARAM_SUBJECT + subject + "&" + MailTo.PARAM_BODY + body;
        return view(url);
    }

    public static Intent mail(String address, String subject) {
        String url = MailTo.PRE_FIX + address + "?" + MailTo.PARAM_SUBJECT + subject;
        return view(url);
    }

    public static Intent mail(String address) {
        String url = MailTo.PRE_FIX + address;
        return view(url);
    }

    private static class MailTo {
        public static final String PRE_FIX = "mailto:";
        public static final String PARAM_SUBJECT = "subject=";
        public static final String PARAM_BODY = "body=";
        public static final String PARAM_BCC = "bcc=";
        public static final String PARAM_CC = "cc=";
        public static final String PARAMETER_PREFIX_FIRST = "?";
        public static final String PARAMETER_PREFIX_DEFAULT = "&";
        public static final String PARAMETER_SEPARATOR = ",";
    }
}




Java Source Code List

at.wrdlbrnft.helpers.ApplicationTest.java
at.wrdlbrnft.helpers.AssetHelper.java
at.wrdlbrnft.helpers.Base64Coder.java
at.wrdlbrnft.helpers.BitHelper.java
at.wrdlbrnft.helpers.BitmapHelper.java
at.wrdlbrnft.helpers.Bundles.java
at.wrdlbrnft.helpers.CanvasHelper.java
at.wrdlbrnft.helpers.Container.java
at.wrdlbrnft.helpers.Containers.java
at.wrdlbrnft.helpers.Dates.java
at.wrdlbrnft.helpers.ExtrasBuilder.java
at.wrdlbrnft.helpers.IntentHelper.java
at.wrdlbrnft.helpers.LayoutHelper.java
at.wrdlbrnft.helpers.LogHelper.java
at.wrdlbrnft.helpers.Maps.java
at.wrdlbrnft.helpers.NetworkHelper.java
at.wrdlbrnft.helpers.Numbers.java
at.wrdlbrnft.helpers.PackageHelper.java
at.wrdlbrnft.helpers.ReflectionHelper.java
at.wrdlbrnft.helpers.SerializationHelper.java
at.wrdlbrnft.helpers.Sets.java
at.wrdlbrnft.helpers.StreamHelper.java
at.wrdlbrnft.helpers.Strings.java
at.wrdlbrnft.helpers.TypeHelper.java
at.wrdlbrnft.helpers.ViewHelper.java
at.wrdlbrnft.helpers.credentials.CredentialsFactory.java
at.wrdlbrnft.helpers.credentials.Credentials.java
at.wrdlbrnft.helpers.lists.Difference.java
at.wrdlbrnft.helpers.lists.Lists.java
at.wrdlbrnft.helpers.lists.UniqueIdProvider.java
at.wrdlbrnft.helpers.lists.UpdateInfo.java
at.wrdlbrnft.helpers.lists.UpdateValueContainer.java
at.wrdlbrnft.helpers.time.Time.java
at.wrdlbrnft.helpers.time.Times.java