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 callPhone(Context mContext, String phoneNumber) {
    Uri uri = Uri.parse("tel:" + phoneNumber);
    Intent call = new Intent(Intent.ACTION_CALL, uri);
    mContext.startActivity(call);/*from   w w  w.  j a  v  a2s.com*/
}

From source file:Main.java

public static Intent getMediaIntent(String path) {
    Intent it = new Intent(Intent.ACTION_VIEW);
    Uri uri = Uri.parse(path);
    it.setDataAndType(uri, "audio/mp3");
    return it;/*from w ww .j a v  a  2s  .  co  m*/
}

From source file:Main.java

public static void startActionCall(String phoneNumber, Context cxt) {
    Uri phoneNum = Uri.parse("tel:" + phoneNumber);
    cxt.startActivity(new Intent(Intent.ACTION_CALL, phoneNum));
}

From source file:Main.java

public static void unInstall(Context context, String packageString) {
    Uri packageURI = Uri.parse("package:" + packageString); //com.demo.CanavaCancel
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
    context.startActivity(uninstallIntent);
}

From source file:Main.java

public static void Unintall(Context context, String packname) {
    Uri packageURI = Uri.parse("package:" + packname);
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
    context.startActivity(uninstallIntent);
}

From source file:Main.java

public static void intentPlaystore(Context context, String url) {
    Uri marketUri = Uri.parse(url);
    Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
    context.startActivity(marketIntent);
}

From source file:Main.java

public static void UnInstallApk(Context context, String pkName) {
    Uri packageURI = Uri.parse(pkName);
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
    context.startActivity(uninstallIntent);
}

From source file:Main.java

public static void uninstallAPK(Context ctx, String packageName) {
    Uri packageURI = Uri.parse("package:" + packageName);
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
    ctx.startActivity(uninstallIntent);/*ww  w . j  av  a 2s  .  co m*/
}

From source file:Main.java

public static void startUninstallApk(Context context, String packageName) {
    Uri uri = Uri.parse("package:" + packageName);
    Intent intent = new Intent(Intent.ACTION_DELETE, uri);
    context.startActivity(intent);//ww w  .  j  av  a  2 s .c o  m
}

From source file:Main.java

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