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.androidquery.simplefeed.activity.FriendsActivity.java

public static void start(Activity act) {

    Intent intent = new Intent(act, FriendsActivity.class);
    act.startActivityForResult(intent, REQUEST);

}

From source file:com.androidquery.simplefeed.activity.PlaceActivity.java

public static void start(Activity act) {

    Intent intent = new Intent(act, PlaceActivity.class);
    act.startActivityForResult(intent, Constants.ACTIVITY_CHECKIN);

}

From source file:com.j1024.mcommon.support.GenericFragmentActivity.java

public static void startForResult(Activity from, int reqCode, Class<?> fragmentClass, Bundle args) {
    if (Safeguard.ignorable(from))
        return;/*  www.j ava  2 s.c om*/

    Intent intent = new Intent(from, GenericFragmentActivity.class);
    intent.putExtra(KEY_FRAGMENT_CLASS, fragmentClass.getCanonicalName());
    intent.putExtra(KEY_FRAGMENT_ARGS, args);
    from.startActivityForResult(intent, reqCode);
}

From source file:Main.java

public static boolean initializeBluetooth(Activity activity) {
    BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    if (mBluetoothAdapter == null) {
        // Device does not support Bluetooth
        return false;
    }//from  w ww  .  java  2s. c  o  m

    int REQUEST_ENABLE_BT = 1;

    if (!mBluetoothAdapter.isEnabled()) {
        Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
        activity.startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
    }

    return false;
}

From source file:com.unovo.frame.uikit.base.container.ContainerActivity.java

public static void launch4Result(Activity activity, Class<? extends Fragment> clazz, Bundle args,
        int requestCode) {
    Intent intent = new Intent(activity, ContainerActivity.class);
    intent.putExtra(FRAGMENT_NAME, clazz.getName());
    if (args != null)
        intent.putExtra(FRAGMENT_ARGS, args);
    activity.startActivityForResult(intent, requestCode);
}

From source file:org.totschnig.myexpenses.activity.CommonCommands.java

public static void showContribDialog(Activity ctx, ContribFeature feature, Serializable tag) {
    Intent i = new Intent(ctx, ContribInfoDialogActivity.class);
    i.putExtra(ContribInfoDialogActivity.KEY_FEATURE, feature);
    i.putExtra(ContribInfoDialogActivity.KEY_TAG, tag);
    ctx.startActivityForResult(i, ProtectionDelegate.CONTRIB_REQUEST);
}

From source file:com.brq.wallet.activity.ScanActivity.java

public static void callMe(Activity currentActivity, int requestCode, StringHandleConfig stringHandleConfig) {
    Intent intent = new Intent(currentActivity, ScanActivity.class);
    intent.putExtra("request", stringHandleConfig);
    currentActivity.startActivityForResult(intent, requestCode);
}

From source file:br.org.funcate.dynamicforms.markers.MarkersUtilities.java

/**
 * Launch intend for result.//from   w w  w.  ja  va  2 s. c o m
 *
 * @param activity    the parent activiuty.
 * @param image       the image to use.
 * @param gpsLocation the position.
 * @param requestCode the return code.
 */
public static void launchForResult(Activity activity, File image, double[] gpsLocation, int requestCode) {
    if (MarkersUtilities.appInstalled(activity)) {
        Intent sketchIntent = prepareIntent(activity, image, gpsLocation);
        activity.startActivityForResult(sketchIntent, requestCode);
    } else {
        MarkersUtilities.openMarketToInstall(activity);
    }
}

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

public static void doCheckPolicy(Activity activity, int requestCode, String responseMessage) {
    if (activity == null || TextUtils.isEmpty(responseMessage)) {
        throw new IllegalArgumentException();
    }//from   w ww. j  a v a  2  s  .c  om
    Intent intent = UAFIntent.getCheckPolicyIntent(new UAFMessage(responseMessage).toJson(),
            activity.getApplication().getPackageName());
    activity.startActivityForResult(intent, requestCode);
}

From source file:com.canking.sdcardhelper.PermissionUtils.java

/**
 * ??//from  w w  w. j  a  va  2s. c om
 *
 * @param cxt
 * @param req
 * @return
 */
@TargetApi(23)
public static <C extends Context> boolean checkSettingAlertPermission(Activity cxt, int req, C t) {
    Activity activity = (Activity) cxt;
    if (!Settings.canDrawOverlays(activity.getBaseContext())) {
        Log.i(TAG, "Setting not permission");

        Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
                Uri.parse("package:" + activity.getPackageName()));
        activity.startActivityForResult(intent, req);
        return false;
    }

    return true;
}