1.AndroidHttpClient的创建DownloadManager:在DownloadThread的run方法里public void run() { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGRO ...
1.AndroidHttpClient的创建
DownloadManager:
在DownloadThread的run方法里
public void run() { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); //从DownloadInfo转化成State State state = new State(mInfo); AndroidHttpClient client = null; PowerManager.WakeLock wakeLock = null; int finalStatus = Downloads.STATUS_UNKNOWN_ERROR; try { //阻止后台休眠 PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Constants.TAG); wakeLock.acquire(); if (Constants.LOGV) { Log.v(Constants.TAG, "initiating download for " + mInfo.mUri); } client = AndroidHttpClient.newInstance(userAgent(), mContext);
原标题:DownloadProvider源码解析——与Volley对比
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。