Android Utililty Methods Intent Create

List of utility methods to do Intent Create

Description

The list of methods to do Intent Create are organized into topic(s).

Method

voidto(Context context, Class cls, Bundle data)
to
Intent intent = new Intent(context, cls);
if (data != null) {
    intent.putExtras(data);
context.startActivity(intent);
voidputParamters(Intent intent, Object[] parameters)
put Paramters
if (parameters.length % 2 == 0) {
    for (int i = 0; i < parameters.length / 2; i += 2) {
        if (parameters[i] instanceof String
                && parameters[i + 1] instanceof Long) {
            intent.putExtra((String) parameters[i],
                    (Long) parameters[i + 1]);
voidintentCall(Activity activity, String phoneNumber)
intent Call
Uri uri = Uri.parse("tel:" + phoneNumber);
Intent it = new Intent(Intent.ACTION_CALL, uri);
activity.startActivity(it);
voidintentDIY(Activity activity, Class classes)
intent DIY
intentDIY(activity, classes, null, DEFAULT_ENTER_ANIM,
        DEFAULT_EXIT_ANIM);
voidintentDIY(Activity activity, Class classes, Map paramMap)
intent DIY
intentDIY(activity, classes, paramMap, DEFAULT_ENTER_ANIM,
        DEFAULT_EXIT_ANIM);
voidintentDIY(Activity activity, Class classes, int enterAnim, int exitAnim)
intent DIY
intentDIY(activity, classes, null, enterAnim, exitAnim);
voidintentDIY(Activity activity, Class classes, Map paramMap, int enterAnim, int exitAnim)
intent DIY
intent = new Intent(activity, classes);
organizeAndStart(activity, classes, paramMap);
if (enterAnim != 0 && exitAnim != 0) {
    activity.overridePendingTransition(enterAnim, exitAnim);
IntentgetCameraIntent(String outputFile)
get Camera Intent
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT,
        Uri.fromFile(new File(outputFile)));
return intent;
UrigetUrifromIntent(Intent data, Uri outputFileUri)
get Urifrom Intent
Uri selectedImageUri;
final boolean isCamera;
if (data == null) {
    isCamera = true;
} else {
    final String action = data.getAction();
    if (action == null) {
        isCamera = false;
...
IntentcreateContactAppIntent()
create Contact App Intent
return Intent.makeMainSelectorActivity(Intent.ACTION_MAIN,
        Intent.CATEGORY_APP_CONTACTS);