Example usage for android.app Activity startActivityForResult

List of usage examples for android.app Activity startActivityForResult

Introduction

In this page you can find the example usage for android.app Activity startActivityForResult.

Prototype

public void startActivityForResult(@RequiresPermission Intent intent, int requestCode) 

Source Link

Document

Same as calling #startActivityForResult(Intent,int,Bundle) with no options.

Usage

From source file:com.stfalcon.socialauthhelper.twitter.TwitterAuthActivity.java

public static void authorize(Activity activity, int requestCode) {
    activity.startActivityForResult(getIntent(activity), requestCode);
    activity.overridePendingTransition(0, 0);
}

From source file:Main.java

public static void captureImage(Activity activity, int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) {
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    activity.startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}

From source file:Main.java

public static void startActivityForResult(Activity context, Class<?> cls, int requestCode) {
    Intent intent = new Intent();
    intent.setClass(context, cls);//from  www.  j a va2 s. co m
    context.startActivityForResult(intent, requestCode);
}

From source file:com.common.ui.util.ActivityUtils.java

public static void startActivityForResult(Activity context, Class<?> cls, int code) {
    Intent intent = new Intent(context, cls);
    context.startActivityForResult(intent, code);
}

From source file:Main.java

public static void choosePicture(Activity activity) {
    Intent openAlbumIntent = new Intent(Intent.ACTION_GET_CONTENT);
    openAlbumIntent.setType("image/*");
    activity.startActivityForResult(openAlbumIntent, CHOOSE_PICTURE);
}

From source file:Main.java

public static void skip(Activity aty, Class clazz, int requestCode) {
    if (aty == null || clazz == null)
        return;// w  ww .  java  2 s .  com
    aty.startActivityForResult(new Intent(aty.getApplicationContext(), clazz), requestCode);
}

From source file:Main.java

public static void goPageForResult(Activity context, int requstcode, Class<?> gopage) {
    Intent intent = new Intent(context, gopage);
    context.startActivityForResult(intent, requstcode);
}

From source file:Main.java

public static void skip(Activity aty, Intent intent, int requestCode) {
    if (aty == null || intent == null)
        return;//  w ww.java 2s  .  c  o  m
    aty.startActivityForResult(intent, requestCode);
}

From source file:Main.java

public static void selectImage(Activity activity, int i) {
    Intent intent = new Intent("android.intent.action.GET_CONTENT");
    intent.setType("image/*");
    activity.startActivityForResult(Intent.createChooser(intent, activity.getString(0x7f080083)), i);
}

From source file:Main.java

public static void openAlbum(Activity activity) {
    Intent intent = new Intent();
    intent.setType("image/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    activity.startActivityForResult(intent, PICK_IMAGE_ACTIVITY_REQUEST_CODE);
}