Example usage for android.net Uri parse

List of usage examples for android.net Uri parse

Introduction

In this page you can find the example usage for android.net Uri parse.

Prototype

public static Uri parse(String uriString) 

Source Link

Document

Creates a Uri which parses the given encoded URI string.

Usage

From source file:Main.java

public static void uninstallApk(Context context, String pkgName) {
    Uri uri = Uri.parse("package:" + pkgName);
    Intent intent = new Intent(Intent.ACTION_DELETE, uri);
    context.startActivity(intent);/*  w ww . j a  v a  2s .c om*/
}

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  va2  s  .c  om
}

From source file:Main.java

public static void IntentWebPage(Context context, String url) {
    Uri uri = Uri.parse(url);
    Intent it = new Intent(Intent.ACTION_VIEW, uri);
    context.startActivity(it);//from  ww  w  .  ja va 2  s .  c  o m
}

From source file:Main.java

public static Intent getCallIntent(String phoneNumber) {
    Intent intent = new Intent("android.intent.action.CALL", Uri.parse("tel:" + phoneNumber));
    return intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}

From source file:Main.java

public static void notifyScanFile(Context context, String fileName) {
    Uri data = Uri.parse("file://" + fileName);
    context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, data));
}

From source file:Main.java

public static void uninstall(Activity activity, String packageName) {
    Uri packageURI = Uri.parse("package:" + packageName);
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
    activity.startActivity(uninstallIntent);
}

From source file:Main.java

public static void phoneCall(Context context, String phoneNumber) {
    Uri phoneCall = Uri.parse("tel:" + phoneNumber);
    Intent caller = new Intent(Intent.ACTION_DIAL, phoneCall);
    context.startActivity(caller);/* w  w w.j ava 2  s  .  co m*/
}

From source file:Main.java

public static final Intent buyFullIntent() {
    Uri fullVersionURI = Uri.parse("market://details?id=net.fhtagn.zoobgame");
    Intent i = new Intent(Intent.ACTION_VIEW, fullVersionURI);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return i;//from   ww  w .  j av a 2s.co m
}

From source file:Main.java

public static void unInstallApp(Context context, String packageName) {
    Uri uri = Uri.parse("package:" + packageName);
    Intent intent = new Intent(Intent.ACTION_DELETE, uri);
    context.startActivity(intent);/* w w w.  j a  v a  2  s.c om*/
}

From source file:Main.java

public static void uninstallApk(Context context, String packageName) {
    Uri uri = Uri.parse("package:" + packageName);
    Intent intent = new Intent(Intent.ACTION_DELETE, uri);
    context.startActivity(intent);//from   www  .  ja  va2s.co m
}