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 packageName) {
    Uri packageURI = Uri.parse("package:" + packageName);
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
    context.startActivity(uninstallIntent);
}

From source file:Main.java

public static void sendSMS(Context context, String number, String message) {
    Uri uri = Uri.parse("smsto:" + number);

    Intent sendIntent = new Intent(Intent.ACTION_VIEW, uri);
    sendIntent.putExtra("sms_body", message);

    context.startActivity(sendIntent);//from w w w  .j ava2s.c  o  m
}

From source file:Main.java

public static void sendMessage(Context context, String number, String message) {
    Uri uri = Uri.parse("smsto:" + number);
    Intent sendIntent = new Intent(Intent.ACTION_VIEW, uri);
    sendIntent.putExtra("sms_body", message);
    context.startActivity(sendIntent);//from   w  ww .  ja  v  a2s. c  o m
}

From source file:Main.java

public static Intent getGooglePlayWebsiteIntent(final String pPackageName) {
    return new Intent(Intent.ACTION_VIEW,
            Uri.parse("http://play.google.com/store/apps/details?id=" + pPackageName));
}

From source file:Main.java

public static void startUnistalledApp(Context mContext, String pkgName) {
    Uri packageUri = Uri.parse("package:" + pkgName);
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageUri);
    uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    mContext.startActivity(uninstallIntent);

}

From source file:Main.java

public static void uninstallAppbyPackageName(Context context, String packageName) {
    Uri uri = Uri.parse("package:" + packageName);
    Intent intent = new Intent(Intent.ACTION_DELETE, uri);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);/*from   w w  w .  j  a  v a  2  s. 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=com.giggs.apps.chaos"));
    activity.startActivity(goToMarket);//from w ww .j a v a2s  .co m
}

From source file:Main.java

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

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);//from  w  w w .  j  a va  2s .c  o m
}