You should always include a verification step before invoking an intent. If you invoke an intent and there is no app available on the device that can handle the intent, your app will crash.
PackageManager packageManager = getPackageManager(); List activities = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); boolean isIntentSafe = activities.size() > 0;
A URI is specified by separate attributes for each of its parts: