Example usage for android.app Activity startActivity

List of usage examples for android.app Activity startActivity

Introduction

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

Prototype

@Override
public void startActivity(Intent intent) 

Source Link

Document

Same as #startActivity(Intent,Bundle) with no options specified.

Usage

From source file:Main.java

public static void requestGooglePlay(Activity activity, String packageName) {
    try {//from w  ww.  ja va2  s  . c om
        activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName)));
    } catch (android.content.ActivityNotFoundException anfe) {
        activity.startActivity(new Intent(Intent.ACTION_VIEW,
                Uri.parse("http://play.google.com/store/apps/details?id=" + packageName)));
    }
}

From source file:com.crea_si.eviacam.wizard.WizardUtils.java

static void finishWizard(Activity a) {
    a.startActivity(new Intent(a, WizardActivity.class)
            .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS));
    a.finish();//  w  ww . j a  v a 2  s  . c  o m
}

From source file:Main.java

/**
 * Reload activity/*from  w  w w. j a  v a 2 s  .co m*/
 *
 * @param activity Activity to be reloaded
 */
public static void reloadActivity(Activity activity) {
    // reload activity
    activity.finish();
    activity.startActivity(activity.getIntent());
}

From source file:Main.java

public static void startActivityWithoutTransition(Activity currentActivity, Intent intent) {
    currentActivity.startActivity(intent);
    disablePendingTransition(currentActivity);
}

From source file:Main.java

public static boolean installFromMarket(Activity activity, String pkg) {
    try {//  ww  w .  j a  va  2s .c o m
        activity.startActivity(new Intent(Intent.ACTION_VIEW, marketUri(pkg)));
        return true;
    } catch (ActivityNotFoundException e) {
        return false;
    }
}

From source file:Main.java

public static void launchActivity(Activity activity, Class activityClass, int enterAnim, int exitAnim) {
    activity.startActivity(new Intent(activity, activityClass));
    activity.overridePendingTransition(enterAnim, exitAnim);
}

From source file:Main.java

public static void changeToTheme(Activity activity, int theme) {
    sTheme = theme;// w  ww  .j  a v  a  2  s.  com
    activity.finish();
    activity.startActivity(new Intent(activity, activity.getClass()));
    activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}

From source file:Main.java

public static void redirect(Activity activity, Class<?> cls) {
    Intent intent = new Intent(activity, cls);
    activity.startActivity(intent);
    activity.overridePendingTransition(0, 0);
}

From source file:Main.java

public static void start(Activity activity, Class<?> clazz) {
    Intent intent = new Intent(activity, clazz);
    activity.startActivity(intent);
}

From source file:Main.java

public static void goActivity(Activity activity, Class clazz) {
    Intent intent = new Intent(activity, clazz);
    activity.startActivity(intent);
}