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.PostActivity.java

public static void start(Activity act, Entity entity) {

    Intent intent = new Intent(act, PostActivity.class);
    intent.putExtra("entity", entity);

    act.startActivityForResult(intent, REQUEST);

}

From source file:eu.geopaparazzi.library.plugin.ActivityStarter.java

@Override
public void startActivityForResult(Intent intent, int requestCode) {
    if (context instanceof Activity) {
        Activity activity = (Activity) context;
        activity.startActivityForResult(intent, requestCode);
    }/*from  w  w  w .j  a va 2  s  . c  om*/
}

From source file:org.onebusaway.android.report.ui.InfrastructureIssueActivity.java

/**
 * Starts the InfrastructureIssueActivity.
 *
 * startActivityForResult was used to close the calling activity. This used in BaseReportActivity
 * to close it when a user submits an issue.
 *
 * @param activity The parent activity.//from   ww  w.  ja v  a2  s  .  c om
 * @param intent   The Intent containing focusId, lat, lon of the map
 */
public static void start(Activity activity, Intent intent) {
    activity.startActivityForResult(makeIntent(activity, intent), REQUEST_CODE);
}

From source file:com.github.kanata3249.ffxieq.android.EquipmentSelectorActivity.java

static public boolean startActivity(Activity from, int request, FFXICharacter charInfo, int part, long current,
        long augId) {
    Intent intent = new Intent(from, EquipmentSelectorActivity.class);

    intent.putExtra("Part", part);
    intent.putExtra("Race", charInfo.getRace());
    intent.putExtra("Job", charInfo.getJob());
    intent.putExtra("Level", charInfo.getJobLevel());
    intent.putExtra("Current", current);
    intent.putExtra("AugId", augId);
    intent.putExtra("Filter", (long) -1);
    intent.putExtra("OrderByName", false);
    intent.putExtra("FilterByType", "");

    from.startActivityForResult(intent, request);
    return true;/*from www .ja va2  s . co  m*/
}

From source file:com.github.kanata3249.ffxieq.android.AugmentSelectorActivity.java

static public boolean startActivity(Activity from, int request, FFXICharacter charInfo, int part, long current,
        long augId) {
    Intent intent = new Intent(from, AugmentSelectorActivity.class);

    intent.putExtra("Part", part);
    intent.putExtra("Race", charInfo.getRace());
    intent.putExtra("Job", charInfo.getJob());
    intent.putExtra("Level", charInfo.getJobLevel());
    intent.putExtra("Current", current);
    intent.putExtra("AugId", augId);
    intent.putExtra("Filter", (long) -1);
    intent.putExtra("OrderByName", false);
    intent.putExtra("FilterByType", "");

    from.startActivityForResult(intent, request);
    return true;/*from  w w w  .  ja v  a2 s  .com*/
}

From source file:com.tsg.kiwitech.tsgsocialsharing.googleUtility.TSGGoogleManager.java

/**
 * call this method for signin user/*  w w w .  j a v a 2s .  c om*/
 *
 * @param activity
 * @param id
 */
public void signIn(Activity activity, int id) {
    Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
    activity.startActivityForResult(signInIntent, id);
}

From source file:com.atwal.wakeup.battery.util.Utilities.java

public static void startActivityForResultSafely(Activity activity, Intent intent, int requestCode) {
    try {//from   w ww .  j a  va 2  s .  c  o m
        activity.startActivityForResult(intent, requestCode);
    } catch (ActivityNotFoundException e) {

    } catch (SecurityException e) {

        Log.e(TAG,
                "Launcher does not have the permission to launch " + intent
                        + ". Make sure to create a MAIN intent-filter for the corresponding activity "
                        + "or use the exported attribute for this activity.",
                e);
    }
}

From source file:com.ykhdzr.flow.Flow.java

private void fromActivity() {
    Activity activity = ((Activity) src);
    if (forResult) {
        activity.startActivityForResult(intent(activity), requestCode);
    } else {//  w  w w .  j  a v a 2 s .  c  o m
        activity.startActivity(intent(activity));
    }
}

From source file:com.microsoft.rightsmanagement.ui.ConsentActivity.java

/**
 * Show UI//from  w  w  w  .j a v  a 2  s . c  o m
 * 
 * @param requestCode
 * @param parentActivity
 * @param consents - consents collection containing serverurlconsent or documentTrackingConsent
 * @param emailActivityCompletionCallback
 */
public static void show(int requestCode, Activity parentActivity, Collection<Consent> consents,
        CompletionCallback<Collection<Consent>> consentActivityCompletionCallback) {
    Logger.ms(TAG, "show");
    parentActivity = validateActivityInputParameter(parentActivity);
    consentActivityCompletionCallback = validateCompletionCallbackInputParameter(
            consentActivityCompletionCallback);
    consents = validateConsentInputParamter(consents);
    ConsentModel consentModel = new ConsentModel(consents);
    int requestCallbackId = consentActivityCompletionCallback.hashCode();
    sCallbackManager.putWaitingRequest(requestCallbackId, consentActivityCompletionCallback, consents);
    Intent intent = new Intent(parentActivity, ConsentActivity.class);
    intent.putExtra(REQUEST_CALLBACK_ID, requestCallbackId);
    intent.putExtra(REQUEST_CONSENT_MODEL, consentModel);
    intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    parentActivity.startActivityForResult(intent, requestCode);
    Logger.me(TAG, "show");
}

From source file:org.onebusaway.android.report.ui.InfrastructureIssueActivity.java

/**
 * Starts the InfrastructureIssueActivity with a given open311 service category selected
 *
 * startActivityForResult was used to close the calling activity. This used in BaseReportActivity
 * to close it when a user submits an issue.
 *
 * @param activity The parent activity.// w w w  .  j a  v  a  2s .c  o  m
 * @param intent   The Intent containing focusId, lat, lon of the map
 */
public static void startWithService(Activity activity, Intent intent, String serviceKeyword) {
    intent = makeIntent(activity, intent);
    intent.putExtra(SELECTED_SERVICE, serviceKeyword);
    activity.startActivityForResult(intent, REQUEST_CODE);
}