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:io.hypertrack.sendeta.util.images.EasyImage.java

public static void openGallery(Activity activity) {
    Intent intent = createGalleryIntent();
    activity.startActivityForResult(intent, REQ_PICK_PICTURE_FROM_GALLERY);
}

From source file:io.hypertrack.sendeta.util.images.EasyImage.java

public static void openDocuments(Activity activity) {
    Intent intent = createDocumentsIntent();
    activity.startActivityForResult(intent, REQ_PICK_PICTURE_FROM_DOCUMENTS);
}

From source file:com.jwetherell.quick_response_code.DecoderActivity.java

public static void start(Activity activity, int requestCode, String toastMessage) {
    final Intent intent = new Intent(activity, DecoderActivity.class);
    intent.putExtra(EXTRA_TOAST_MESSAGE, toastMessage);
    activity.startActivityForResult(intent, requestCode);
}

From source file:io.hypertrack.sendeta.util.images.EasyImage.java

public static void openCamera(Activity activity) {
    Intent intent = createCameraIntent(activity);
    activity.startActivityForResult(intent, REQ_TAKE_PICTURE);
}

From source file:com.yalin.fidoclient.api.UAFClientApi.java

public static void doOperation(Activity activity, int requestCode, String responseMessage,
        String channelBinding) {//from www .  jav  a2  s.  c o  m
    if (activity == null || TextUtils.isEmpty(responseMessage)) {
        throw new IllegalArgumentException();
    }
    Intent intent = UAFIntent.getUAFOperationIntent(new UAFMessage(responseMessage).toJson(), null,
            channelBinding);
    activity.startActivityForResult(intent, requestCode);
}

From source file:com.owncloud.android.ui.activity.LocalFolderPickerActivity.java

/**
 * Helper to launch a {@link LocalFolderPickerActivity} for which you would like a result when finished.
 * Your onActivityResult() method will be called with the given requestCode.
 *
 * @param activity      Activity calling {@link LocalFolderPickerActivity} for a result.
 * @param startPath     Absolute path to the local folder to show when the activity is shown.
 * @param requestCode   If >= 0, this code will be returned in onActivityResult().
 *///from  ww  w.  ja va2  s .  co m
public static void startLocalFolderPickerActivityForResult(Activity activity, String startPath,
        int requestCode) {
    Intent action = new Intent(activity, LocalFolderPickerActivity.class);
    action.putExtra(LocalFolderPickerActivity.EXTRA_PATH, startPath);
    activity.startActivityForResult(action, requestCode);
}

From source file:Main.java

public static void openActivity(Activity activity, String pAction, Bundle pBundle, int requestCode) {
    if (null == activity)
        return;/*from ww  w. jav a  2  s  . c o m*/

    Intent intent = new Intent(pAction);
    if (pBundle != null) {
        intent.putExtras(pBundle);
    }

    if (requestCode < 0) {
        activity.startActivity(intent);
    } else {
        activity.startActivityForResult(intent, requestCode);
    }
}

From source file:com.cyanogenmod.account.util.CMAccountUtils.java

public static void launchWifiSetup(Activity context) {
    CMAccountUtils.tryEnablingWifi(context);
    Intent intent = getWifiSetupIntent(context);
    context.startActivityForResult(intent, CMAccount.REQUEST_CODE_SETUP_WIFI);
}

From source file:com.phonemetra.account.util.AccountUtils.java

public static void launchWifiSetup(Activity context) {
    AccountUtils.tryEnablingWifi(context);
    Intent intent = getWifiSetupIntent(context);
    context.startActivityForResult(intent, Account.REQUEST_CODE_SETUP_WIFI);
}

From source file:Main.java

public static void toActivity(final Activity context, final Intent intent, final int requestCode,
        final boolean showAnimation) {
    if (context == null || intent == null) {
        return;// ww w.ja  v a  2s  . c  o  m
    }
    context.runOnUiThread(new Runnable() {
        @Override
        public void run() {

            if (requestCode < 0) {
                context.startActivity(intent);
            } else {
                context.startActivityForResult(intent, requestCode);
            }
            //            if (showAnimation) {
            //               context.overridePendingTransition(R.anim.right_push_in, R.anim.hold);
            //            } else {
            //               context.overridePendingTransition(R.anim.null_anim, R.anim.null_anim);
            //            }
        }
    });
}