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 dial(String tel, Activity activity) {
    activity.startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(tel)));
}

From source file:Main.java

public static String createDialNumber(String bridge, String host, String code) {

    String dialString = "tel:";
    dialString = dialString + bridge + Uri.parse(",") + Uri.parse(",");
    if (host != null && !host.isEmpty()) {
        dialString = dialString + host + Uri.parse("#");
    }/*www  . j  av  a  2s  .  co m*/
    if (code != null && !code.isEmpty()) {
        dialString = dialString + Uri.parse(",") + code + Uri.parse("#");
    }
    return dialString;
}

From source file:Main.java

public static void call(Context context, String number) {
    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
    context.startActivity(intent);/*from  ww  w  .j  a va 2 s .  c  om*/
}

From source file:Main.java

/**
 * get the path segments//from   ww  w .jav a 2 s. c o m
 * @param url
 * @return
 */
public static List<String> getPathSegments(String url) {
    return Uri.parse(url).getPathSegments();
}

From source file:Main.java

public static void dial(Context context, String tel) {
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + tel));
    context.startActivity(intent);/* w w  w .j a v a2 s .  c  om*/
}

From source file:Main.java

public static Intent getBrowserIntent(String url) {
    Intent browserIntent = new Intent(Intent.ACTION_VIEW);
    browserIntent.setData(Uri.parse(url));
    return browserIntent;
}

From source file:Main.java

public static void call(Context context, String tel) {
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + tel));
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);//w  w w. j av  a 2  s .co m
}

From source file:Main.java

public static void call(Context context, String phone) {
    Intent callIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phone));
    context.startActivity(callIntent);/*from  w ww  .  j ava  2s.c  o m*/
}

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  av a 2s  .c o m
}

From source file:Main.java

public static Uri getUriFromNet(String url) {
    if (TextUtils.isEmpty(url)) {
        return Uri.parse("");
    } else {/*from w w w  .ja va  2 s  .  c o  m*/
        return Uri.parse(url);
    }
}