Example usage for android.app Activity getIntent

List of usage examples for android.app Activity getIntent

Introduction

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

Prototype

public Intent getIntent() 

Source Link

Document

Return the intent that started this activity.

Usage

From source file:Main.java

public static void removeOcfFlag(Activity activity) {
    activity.getIntent().removeExtra("com.pinterest.EXTRA_OCF_FLAG");
}

From source file:Main.java

public static void resetPendingData(Activity activity) {
    activity.getIntent().putExtra(EXTRA_TAKE_PHOTO, "");
    activity.getIntent().putExtra(EXTRA_TAKE_VIDEO, "");
}

From source file:Main.java

public static final boolean checkActivityIsRoot(Activity act) {
    return !(act.getIntent().hasExtra(ARG_INTENT_NOT_ROOT));
}

From source file:Main.java

public static void resetPendingState(Activity activity) {
    if (activity.getIntent().getIntExtra(EXTRA_PENDING_STATE, PENDING_STATE_NONE) != PENDING_STATE_NONE) {
        activity.getIntent().putExtra(EXTRA_PENDING_STATE, PENDING_STATE_NONE);
    }//from www.j  a va2s. co  m
}

From source file:Main.java

public static Bundle getDialogBundle(Activity activity, String str) {
    return activity.getIntent().getExtras().getBundle(str);
}

From source file:Main.java

public static <T> T getBundleParecelableExtra(Activity activity, String key) {
    return activity.getIntent().getParcelableExtra(key);
}

From source file:Main.java

public static void restartActivity(Activity activity) {
    Intent intent = activity.getIntent();
    activity.finish();/* w w  w. j  ava 2  s .  c  o  m*/
    activity.startActivity(intent);
}

From source file:Main.java

static boolean isSingleFragmentIntent(Activity activity) {
    Bundle param = activity.getIntent().getBundleExtra(SINGLE_FRAGMENT_ACTIVITY_START_ME_PARAM);
    return param != null;
}

From source file:Main.java

private static void closeActivity(Activity activity) {
    Intent intent = activity.getIntent();
    activity.setResult(Activity.RESULT_OK, intent);
    activity.finish();/* www .j  a  va  2  s  .  c  o m*/
}

From source file:Main.java

public static void returnControlToCallingActivity(Activity activity) {
    activity.setResult(activity.getIntent().getIntExtra("requestCode", 0));
    activity.finish();/*from w w w  .  j  ava  2  s. co  m*/
}