Uri from String

×

Error message

  • Warning: count(): Parameter must be an array or an object that implements Countable in bootstrap_table() (line 114 of /home/porquefu/public_html/android-snippets.com/sites/all/themes/bootstrap/templates/system/table.func.php).
  • Warning: count(): Parameter must be an array or an object that implements Countable in bootstrap_table() (line 189 of /home/porquefu/public_html/android-snippets.com/sites/all/themes/bootstrap/templates/system/table.func.php).
  • Warning: count(): Parameter must be an array or an object that implements Countable in bootstrap_table() (line 238 of /home/porquefu/public_html/android-snippets.com/sites/all/themes/bootstrap/templates/system/table.func.php).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home/porquefu/public_html/android-snippets.com/includes/common.inc).
  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /home/porquefu/public_html/android-snippets.com/includes/menu.inc).
+1
-173
-1
You voted '+1'.
One short snippet: turn a String into a Uri, really a built-in function from Uri class, but frequently asked by beginners.
XML code: 
JAVA code: 
public static Uri string2Uri(String source)
{
	return Uri.parse(source);
}