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 jumpActivityDefault(Context context, Class<? extends Activity> activityClass) {
    Intent intent = new Intent(context, activityClass);
    context.startActivity(intent);//from   w w w. ja v  a2 s . c  o m
}

From source file:Main.java

public static void startActivityForBundleData(Context act, Class<?> cls, Bundle bundle) {
    Intent intent = new Intent(act, cls);
    intent.putExtras(bundle);//from  w  ww  .  j  a  v a  2s.  c  o  m
    act.startActivity(intent);
}

From source file:Main.java

public static boolean startDial(Context context, String number) {
    try {//from   w w w.jav a  2 s.  c o m
        context.startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + number)));
    } catch (Exception e) {
        return false;
    }

    return true;
}

From source file:Main.java

public static List<ResolveInfo> getAllApp(Context context) {
    Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
    mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
    return context.getPackageManager().queryIntentActivities(mainIntent, 0);
}

From source file:Main.java

public static void jumpActivityForResult(Activity context, Class<? extends Activity> activityClass,
        int requestCode) {
    Intent intent = new Intent(context, activityClass);
    context.startActivityForResult(intent, requestCode);
}