Creates a new URL instance by parsing spec.
Throws: MalformedURLException - if spec could not be parsed as a URL.
1. Declare a URL object named myURL.
2. In the MainActivity.java file, add the below line to the imports section.
import java.net.MalformedURLException;
3. Add the below line to the onCreate method.
try {
myUrl = new URL("http://www.androidsbs.blogspot.com");
} catch (MalformedURLException e) {
e.printStackTrace();
//Toast.makeText(this, "URL: Malformed URL Exception", Toast.LENGTH_LONG).show();
}