I would like to use intent.setData(Uri uri) to pass data obtained from a URL. In order to do this, I need to be able to create a Uri from a URL (or from a byte
use intent.setData(Uri uri)
Use URL.toURI() (Android doc) method.
Example:
URL url = new URL("http://www.google.com"); //Some instantiated URL object URI uri = url.toURI();
Make sure to handle relevant exception, such as URISyntaxException.