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 void goToGitHub(Context context) {
    Uri uriUrl = Uri.parse("http://github.com/jfeinstein10/slidingmenu");
    Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);
    context.startActivity(launchBrowser);
}

From source file:Main.java

public static void openView(Context context, String url) {
    try {/* w w  w . ja v  a 2 s .  co  m*/
        Intent intentUri = new Intent(Intent.ACTION_VIEW);
        intentUri.setData(Uri.parse(url));
        intentUri.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intentUri);
    } catch (Exception e) {
    }
}

From source file:Main.java

public static final Intent getEditorIntent() {
    Uri uri = Uri.parse("market://details?id=net.fhtagn.zoobeditor");
    Intent i = new Intent(Intent.ACTION_VIEW, uri);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return i;//from ww w.ja v a 2s.  c o m
}

From source file:Main.java

public static Intent getInstallIntent(File file) {
    Intent intent = new Intent();
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setAction(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
    return intent;
}

From source file:Main.java

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

From source file:Main.java

private static Intent getAllIntent(String filePath) {

    Intent intent = new Intent();
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setAction(android.content.Intent.ACTION_VIEW);
    Uri uri = Uri.fromFile(new File(filePath));
    intent.setDataAndType(uri, "*/*");
    return intent;
}

From source file:Main.java

public static void instanll(File file, Context context) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setAction(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
    context.startActivity(intent);/*from w  w  w  .  java2  s  .c o  m*/
}

From source file:Main.java

public static void viewMaps(Context context, String addressText) {
    String uri = "geo:" + 0 + "," + 0 + "?q=" + addressText;
    context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(uri)));
}

From source file:Main.java

public static Intent getInstallApkIntent(File file) {
    Intent intent = new Intent();
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setAction(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
    return intent;
}

From source file:Main.java

public static void searchApp(Context context, String packageName) {
    Uri uri = Uri.parse("market://search?q=" + packageName);
    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    context.startActivity(intent);//w w w.  j a v a2  s  . c  om
}