public static void launchWebBrowser ( final Context context , final String url ) { if ( context != null && url != null && ! "" . equals ( url ) ) { final Intent browserIntent = new Intent ( Intent . ACTION_VIEW , Uri . parse ( url ) ) ; if ( browserIntent . resolveActivity ( context . getPackageManager ( ) ) != null ) { context . startActivity ( browserIntent ) ; } else { ToastUtils . quickToast ( context , "Sorry, Could not open the link. You do not have an application installed to open it." ) ; Log . e ( "Caffeine" , "Failed to open link, because an application is not available to view it." ) ; } } else { ToastUtils . quickToast ( context , "Sorry, Could not open link. No URL provided." ) ; } }
Start Intent to launch web browser .