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

protected Intent(Parcel in) 

Source Link

Usage

From source file:Main.java

public static void captureImage(Activity activity, int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) {
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    activity.startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}

From source file:Main.java

public static void openWirelessSettings(Context context) {
    if (android.os.Build.VERSION.SDK_INT > 10) {
        context.startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));
    } else {/*  ww w .jav  a2  s .co m*/
        context.startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS));
    }
}

From source file:Main.java

public static void install(Context context, String filePath) {
    Intent i = new Intent(Intent.ACTION_VIEW);
    i.setDataAndType(Uri.parse("file://" + filePath), "application/vnd.android.package-archive");
    i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(i);//from w  w  w.j  a  v a  2  s. c  o  m
}

From source file:Main.java

public static void sysCall(Context context, String callTo) {
    Intent intent = new Intent(Intent.ACTION_CALL);
    intent.setData(Uri.parse("tel:" + callTo));
    context.startActivity(intent);/*from w  ww. jav a 2s.  com*/
}

From source file:Main.java

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