Here you can find the source of callHTTPDownload(Context context, String chooserTilte, String url)
public static void callHTTPDownload(Context context, String chooserTilte, String url)
//License from project: Open Source License import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Looper; import android.telephony.TelephonyManager; import android.util.DisplayMetrics; import android.view.View; import android.view.WindowManager; import android.webkit.URLUtil; public class Main{ public static void callHTTPDownload(Context context, String chooserTilte, String url) { if (null == context) { return; }//ww w. j a v a 2 s.c o m // update v2 Intent intent = new Intent(Intent.ACTION_VIEW); // intent.setAction(Intent.ACTION_VIEW); // intent.addCategory(Intent.CATEGORY_BROWSABLE); intent.setData(Uri.parse(URLUtil.guessUrl(url))); // intent.setDataAndType(Uri.parse(URLUtil.guessUrl(url)), "text/html"); try { context.startActivity(Intent .createChooser(intent, chooserTilte).addFlags( Intent.FLAG_ACTIVITY_NEW_TASK)); } catch (Exception e) { ToastUtil.showToast(context, "exception"); } } }