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 Intent buildMarketIntent() {
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.garlicg.cutin"));
    return intent;
}

From source file:Main.java

public static void call(Context ctx, String number) {
    Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
    ctx.startActivity(callIntent);/*  w w w.ja va2s. c  o  m*/
}

From source file:Main.java

public static void rateTheApp(Activity activity) {
    Intent goToMarket = new Intent(Intent.ACTION_VIEW,
            Uri.parse("market://details?id=" + activity.getPackageName()));
    activity.startActivity(goToMarket);/* ww w .j av  a2  s . c o m*/
}

From source file:Main.java

public static Intent getBrowserIntent(String url) {
    Uri uri = Uri.parse(url);
    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    return intent;
}

From source file:Main.java

public static void dial(String tel, Activity activity) {
    activity.startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(tel)));
}

From source file:Main.java

public static void call(Context context, String number) {
    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
    context.startActivity(intent);/*from ww  w .  ja va2 s  .c o m*/
}

From source file:Main.java

public static void openActivityFromHistory(Activity activity, Class<?> pClass) {
    Intent intent = new Intent(activity, pClass);
    intent.setFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY);
    activity.startActivity(intent);/*from   w ww  .ja va 2s.  co  m*/
}

From source file:Main.java

public static void dial(Context context, String tel) {
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + tel));
    context.startActivity(intent);//from w  w  w. j a va  2 s. c  o  m
}

From source file:Main.java

private static Intent getNewStandardIntent(Context packageContext, Class<?> cls) {
    Intent intent = new Intent(packageContext, cls);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    return intent;
}

From source file:Main.java

public static void call(Context context, String tel) {
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + tel));
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);/*from  w w w .j  a va  2  s.  c o  m*/
}