Example usage for android.content Intent Intent

List of usage examples for android.content Intent Intent

Introduction

In this page you can find the example usage for android.content Intent Intent.

Prototype

public Intent(Context packageContext, Class<?> cls) 

Source Link

Document

Create an intent for a specific component.

Usage

From source file:Main.java

public static void startActivityForResult(Activity context, Class<?> cls, String data, int flag) {
    Intent intent = new Intent(context, cls);
    intent.putExtra("data", data);
    intent.setFlags(flag);/*  www.ja v a  2s .  c  om*/
    context.startActivityForResult(intent, flag);
}

From source file:Main.java

public static Intent uninstall(String packageName) {
    Uri uri = Uri.parse("package:" + packageName);
    Intent intent = new Intent(Intent.ACTION_DELETE, uri);
    return intent;
}

From source file:Main.java

private static void uninstallManually(Context context, String packageName) {
    Intent intent = new Intent(Intent.ACTION_DELETE, Uri.fromParts("package", packageName, null));
    context.startActivity(intent);/* w w w. java  2 s . c om*/
}

From source file:Main.java

public static void uninstallAPK(Context context, String packageName) {
    context.startActivity(new Intent("android.intent.action.DELETE",
            Uri.parse(new StringBuilder("package:").append(packageName).toString())));
}

From source file:Main.java

public static void skipActivity(Context context, Class<?> goal) {
    Intent intent = new Intent(context, goal);
    context.startActivity(intent);/*  w w w  .  j  a v  a2s . c  om*/
}

From source file:Main.java

public static void openUrlInBrowser(Context context, String url) {
    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    context.startActivity(browserIntent);
}

From source file:Main.java

public static void startActivityForResult(Activity activity, Class<?> cls, String data, int flag) {
    Intent intent = new Intent(activity, cls);
    intent.putExtra("data", data);
    intent.setFlags(flag);/*from   w ww  .ja  v a 2  s  .  c o  m*/
    activity.startActivityForResult(intent, flag);
}

From source file:Main.java

public static void startActivity(Context context, Class clzz) {
    if (context != null) {
        Intent intent = new Intent(context, clzz);
        context.startActivity(intent);//from  ww  w.  j av a2  s  . c  om
    }
}

From source file:Main.java

public static void goActivity(Context context, Class<?> clz) {
    Intent intent = new Intent(context, clz);
    context.startActivity(intent);
}

From source file:Main.java

private static void openUrlInBrowser(Context context, String url) {
    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    context.startActivity(browserIntent);
}