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: 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
-101
-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);
}