Here you can find the source of createUriFromString(String uriString)
Parameter | Description |
---|---|
uriString | - the URI string from Sipgate (without "//") |
public static Uri createUriFromString(String uriString)
//package com.java2s; //License from project: Open Source License import android.net.Uri; public class Main { /**/*from w ww. ja v a 2 s. c o m*/ * Sipgate sends "URIs" without the "//", so we have to insert them. * * @param uriString - the URI string from Sipgate (without "//") * @return A Uri object */ public static Uri createUriFromString(String uriString) { Uri uri; if (uriString.startsWith("sip://")) { uri = Uri.parse(uriString); } else { StringBuilder uriBuilder = new StringBuilder(uriString); uri = Uri.parse(uriBuilder.insert(4, "//").toString()); } return uri; } }