Surround the block startActivity()in try-catch. It's all.
Your catchwill handle ActivityNotFoundException.
2Dee:
, , autoLink:web XML, OP -, , Google. onCreate(), , Activity . , TextView setAutoLinkMask(Linkify.WEB_URL)
:
Intent checkBrowser = new Intent(Intent.ACTION_VIEW);
checkBrowser.setData("http://www.grumpycat.com");
List<ResolveInfo> info = context.getPackageManager().queryIntentActivities(checkBrowser,0);
if(info.getSize() > 0){
TextView tv = (TextView) findElementById(R.id.tv);
tv.setAutoLinkMask(Linkify.WEB_URL);
}