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() 

Source Link

Document

Create an empty intent.

Usage

From source file:Main.java

public static void jumpToSystemShareImage(Context context, String imageUri) {
    Intent shareIntent = new Intent();
    shareIntent.setAction("android.intent.action.SEND");
    shareIntent.putExtra("android.intent.extra.STREAM", imageUri);
    shareIntent.setType("image/*");
    context.startActivity(shareIntent);/*  w  ww  .  j  a v a 2s .  c o m*/
}

From source file:Main.java

public static void Go(Context context, Class<?> class1) {
    Intent intent = new Intent();
    intent.setClass(context, class1);
    context.startActivity(intent);/*www.  java2s .  c  o  m*/
}

From source file:Main.java

public static void openURL(Activity activity, String url) {
    Intent intent = new Intent();
    intent.setAction("android.intent.action.VIEW");
    Uri content_url = Uri.parse(url);//  w w w.j av  a 2s  .  c om
    intent.setData(content_url);
    activity.startActivity(intent);
}

From source file:Main.java

public static void callBrowser(Context context, String uri) {
    Intent intent = new Intent();
    intent.setData(Uri.parse(uri));/*w  w  w.  j  av  a  2  s .  c  o m*/
    intent.setAction(Intent.ACTION_VIEW);
    context.startActivity(intent);
}

From source file:Main.java

public static boolean sendEmailToDeveleper(Activity act) {
    Intent intent = new Intent();
    intent.setAction("android.intent.action.VIEW");
    Uri content_url = Uri.parse("https://mail.qq.com");
    intent.setData(content_url);//from  ww w .j a v a 2 s.  co m
    act.startActivity(intent);
    return true;
}

From source file:Main.java

public static void openBrowser(Context context, String url) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setData(Uri.parse(url));/*from w  w  w .  ja  v a2 s.  c  om*/
    context.startActivity(intent);
}

From source file:Main.java

public static void uninstall(Context context, String pkgname) {

    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_DELETE);
    intent.setData(Uri.parse("package:" + pkgname));
    context.startActivity(intent);/*from ww w. j a va  2  s . c  o m*/
}

From source file:Main.java

public static void callNum(Context context, String number) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_CALL);
    intent.setData(Uri.parse("tel:" + number));
    context.startActivity(intent);//from   w ww .ja  v a 2 s  .  c  om
}

From source file:Main.java

public static void gotoMarket(Context context, String pck) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("market://details?id=" + pck));
    context.startActivity(intent);//from   www  .j  a v  a 2 s  .c  om
}

From source file:Main.java

public static void callPhone(Context context, String number) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_DIAL);
    intent.setData(Uri.parse(String.format("tel:%s", number)));
    context.startActivity(intent);/* w w w.  j  av  a2 s  .c  o  m*/
}