Example usage for android.content Intent ACTION_VIEW

List of usage examples for android.content Intent ACTION_VIEW

Introduction

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

Prototype

String ACTION_VIEW

To view the source code for android.content Intent ACTION_VIEW.

Click Source Link

Document

Activity Action: Display the data to the user.

Usage

From source file:Main.java

public static Intent getRouteIntent(Uri uri) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setData(uri);
    return intent;
}

From source file:Main.java

public static void gotoMarket(Activity activity) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("market://details?id=com.bitime.emoji"));
    activity.startActivity(intent);/*from   w w w  .  ja va 2 s. c  om*/
}

From source file:Main.java

public static void rateTheApp(Activity activity) {
    Intent goToMarket = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.giggs.apps.chaos"));
    activity.startActivity(goToMarket);/*from w  w  w .j a  va2  s  .  c o  m*/
}

From source file:Main.java

public static void openKindleApp(Context context) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("kindle:"));
    context.startActivity(intent);/*from   w  ww.  j  a  v  a2  s  . c  o m*/
}

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 rateTheApp(Activity activity) {
    Intent goToMarket = new Intent(Intent.ACTION_VIEW,
            Uri.parse("market://details?id=" + activity.getPackageName()));
    activity.startActivity(goToMarket);/* w w w  .jav a 2s  .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 sendSMS(final Context context, String message) {
    final Intent sendIntent = new Intent(Intent.ACTION_VIEW);
    sendIntent.putExtra("sms_body", message);
    sendIntent.setType("vnd.android-dir/mms-sms");
    context.startActivity(sendIntent);/* w w w . java 2s .  c o m*/
}

From source file:Main.java

public static void openWeb(Context context, String url) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse(url));/*ww w. java2  s.co m*/
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
}

From source file:Main.java

public static void dowloadBySystem(Context context, String url) {
    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    context.startActivity(i);//from   w w w.  j  ava  2  s.c om
}