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 boolean testingShowWebView(final Activity activity, final String aid, final String url) {
    if (TextUtils.isEmpty(url)) {
        Intent intent = new Intent(adWebAction);
        intent.putExtra("aid", aid);
        if (intent.resolveActivity(activity.getPackageManager()) != null) {
            activity.startActivity(intent);
        }/*from  w  w  w .j  a v  a 2s  .  com*/
        return true;
    }

    return false;
}

From source file:com.app.common.util.IntentUtils.java

public static void startActivity(Activity activity, Class<?> cls, Bundle bundle) {
    Intent intent = new Intent();
    intent.setClass(activity, cls);/*  ww w.j a  va  2  s. c  o  m*/
    if (null != bundle) {
        intent.putExtras(bundle);
    }

    activity.startActivity(intent);
}

From source file:com.dongmihui.im.activity.GroupsActivity.java

public static void startGroupsActivity(Activity activity) {
    if (activity != null) {
        Intent intent = new Intent(activity, GroupsActivity.class);
        activity.startActivity(intent);
    }/* www .  j  ava2s.  c  o  m*/
}

From source file:Main.java

public static void openActivity(Activity activity, Intent intent, int requestCode, int enterAnim,
        int exitAnim) {
    if (null == activity)
        return;/*w ww  . j  av  a  2 s. c  o  m*/

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

    if (enterAnim > 0 && exitAnim > 0) {
        activity.overridePendingTransition(enterAnim, exitAnim);
    }
}

From source file:Main.java

public static void install(Activity activity, File apkFile) {
    Intent intent = new Intent();
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setAction(android.content.Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
    activity.startActivity(intent);
}

From source file:com.brq.wallet.lt.activity.ViewTraderInfoActivity.java

public static void callMe(Activity currentActivity, PublicTraderInfo traderInfo) {
    Intent intent = new Intent(currentActivity, ViewTraderInfoActivity.class);
    intent.putExtra("traderInfo", traderInfo);
    intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
    currentActivity.startActivity(intent);
}

From source file:Main.java

public static void disImage(Activity act, File file) {
    Intent itt = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
    itt.setData(Uri.fromFile(file));/* w ww. jav a  2  s .  c om*/
    act.sendBroadcast(itt);

    Intent it = new Intent(Intent.ACTION_VIEW);
    it.setDataAndType(Uri.parse(file.getPath()), "image/*");
    act.startActivity(it);
}

From source file:com.samknows.measurement.util.LoginHelper.java

public static void openMainScreen(Activity acc) {
    Intent intent = new Intent(acc, SamKnowsAggregateStatViewerActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
    acc.startActivity(intent);
    acc.finish();/* w ww .ja va2  s. c om*/
}

From source file:com.peoit.twopointcf.ui.activity.ViewPagerPhotoViewActivity.java

public static void startThisActivity(ArrayList<String> imgList, int position, Activity context) {
    Intent intent = new Intent(context, ViewPagerPhotoViewActivity.class);
    intent.putStringArrayListExtra("imgList", imgList);
    intent.putExtra("position", position);
    context.startActivity(intent);
}

From source file:edu.stanford.mobisocial.dungbeetle.model.Feed.java

public static void view(Activity foreground, Uri feedUri) {
    Log.d("MMSSBB", "viewing " + feedUri);
    Intent launch = new Intent(Intent.ACTION_VIEW);
    launch.setDataAndType(feedUri, MIME_TYPE);
    foreground.startActivity(launch);
}