|
|
@ -4,7 +4,6 @@ import android.content.Context; |
|
|
|
import android.support.annotation.NonNull; |
|
|
|
import android.support.annotation.NonNull; |
|
|
|
import android.util.Log; |
|
|
|
import android.util.Log; |
|
|
|
import android.util.SparseArray; |
|
|
|
import android.util.SparseArray; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.InputStream; |
|
|
@ -13,6 +12,7 @@ import java.net.HttpURLConnection; |
|
|
|
import java.net.MalformedURLException; |
|
|
|
import java.net.MalformedURLException; |
|
|
|
import java.net.URL; |
|
|
|
import java.net.URL; |
|
|
|
import java.util.Properties; |
|
|
|
import java.util.Properties; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by lyy on 2015/8/25. |
|
|
|
* Created by lyy on 2015/8/25. |
|
|
|
* 下载工具类 |
|
|
|
* 下载工具类 |
|
|
@ -37,34 +37,39 @@ public class DownLoadUtil { |
|
|
|
boolean isNewTask = true; |
|
|
|
boolean isNewTask = true; |
|
|
|
private int mCancelNum = 0; |
|
|
|
private int mCancelNum = 0; |
|
|
|
private int mStopNum = 0; |
|
|
|
private int mStopNum = 0; |
|
|
|
|
|
|
|
|
|
|
|
public DownLoadUtil() { |
|
|
|
public DownLoadUtil() { |
|
|
|
} |
|
|
|
} |
|
|
|
public IDownloadListener getListener(){ |
|
|
|
|
|
|
|
|
|
|
|
public IDownloadListener getListener() { |
|
|
|
return mListener; |
|
|
|
return mListener; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取当前下载位置 |
|
|
|
* 获取当前下载位置 |
|
|
|
* |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public long getCurrentLocation() { |
|
|
|
public long getCurrentLocation() { |
|
|
|
return mCurrentLocation; |
|
|
|
return mCurrentLocation; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isDownloading() { |
|
|
|
public boolean isDownloading() { |
|
|
|
return isDownloading; |
|
|
|
return isDownloading; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 取消下载 |
|
|
|
* 取消下载 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void cancelDownload() { |
|
|
|
public void cancelDownload() { |
|
|
|
isCancel = true; |
|
|
|
isCancel = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 停止下载 |
|
|
|
* 停止下载 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void stopDownload() { |
|
|
|
public void stopDownload() { |
|
|
|
isStop = true; |
|
|
|
isStop = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 多线程断点续传下载文件,暂停和继续 |
|
|
|
* 多线程断点续传下载文件,暂停和继续 |
|
|
|
* |
|
|
|
* |
|
|
@ -73,8 +78,8 @@ public class DownLoadUtil { |
|
|
|
* @param filePath 保存路径 |
|
|
|
* @param filePath 保存路径 |
|
|
|
* @param downloadListener 下载进度监听 {@link DownloadListener} |
|
|
|
* @param downloadListener 下载进度监听 {@link DownloadListener} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void download(final Context context, @NonNull final String downloadUrl, @NonNull final String filePath, |
|
|
|
public void download(final Context context, @NonNull final String downloadUrl, |
|
|
|
@NonNull final IDownloadListener downloadListener) { |
|
|
|
@NonNull final String filePath, @NonNull final IDownloadListener downloadListener) { |
|
|
|
isDownloading = true; |
|
|
|
isDownloading = true; |
|
|
|
mCurrentLocation = 0; |
|
|
|
mCurrentLocation = 0; |
|
|
|
isStop = false; |
|
|
|
isStop = false; |
|
|
@ -83,7 +88,8 @@ public class DownLoadUtil { |
|
|
|
mStopNum = 0; |
|
|
|
mStopNum = 0; |
|
|
|
final File dFile = new File(filePath); |
|
|
|
final File dFile = new File(filePath); |
|
|
|
//读取已完成的线程数
|
|
|
|
//读取已完成的线程数
|
|
|
|
final File configFile = new File(context.getFilesDir().getPath() + "/temp/" + dFile.getName() + ".properties"); |
|
|
|
final File configFile = |
|
|
|
|
|
|
|
new File(context.getFilesDir().getPath() + "/temp/" + dFile.getName() + ".properties"); |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (!configFile.exists()) { //记录文件被删除,则重新下载
|
|
|
|
if (!configFile.exists()) { //记录文件被删除,则重新下载
|
|
|
|
isNewTask = true; |
|
|
|
isNewTask = true; |
|
|
@ -97,8 +103,7 @@ public class DownLoadUtil { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
new Thread(new Runnable() { |
|
|
|
new Thread(new Runnable() { |
|
|
|
@Override |
|
|
|
@Override public void run() { |
|
|
|
public void run() { |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
mListener = downloadListener; |
|
|
|
mListener = downloadListener; |
|
|
|
URL url = new URL(downloadUrl); |
|
|
|
URL url = new URL(downloadUrl); |
|
|
@ -106,8 +111,10 @@ public class DownLoadUtil { |
|
|
|
conn.setRequestMethod("GET"); |
|
|
|
conn.setRequestMethod("GET"); |
|
|
|
conn.setRequestProperty("Charset", "UTF-8"); |
|
|
|
conn.setRequestProperty("Charset", "UTF-8"); |
|
|
|
conn.setConnectTimeout(TIME_OUT * 4); |
|
|
|
conn.setConnectTimeout(TIME_OUT * 4); |
|
|
|
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"); |
|
|
|
conn.setRequestProperty("User-Agent", |
|
|
|
conn.setRequestProperty("Accept", "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"); |
|
|
|
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"); |
|
|
|
|
|
|
|
conn.setRequestProperty("Accept", |
|
|
|
|
|
|
|
"image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"); |
|
|
|
conn.connect(); |
|
|
|
conn.connect(); |
|
|
|
int len = conn.getContentLength(); |
|
|
|
int len = conn.getContentLength(); |
|
|
|
if (len < 0) { //网络被劫持时会出现这个问题
|
|
|
|
if (len < 0) { //网络被劫持时会出现这个问题
|
|
|
@ -168,7 +175,9 @@ public class DownLoadUtil { |
|
|
|
} |
|
|
|
} |
|
|
|
//分配下载位置
|
|
|
|
//分配下载位置
|
|
|
|
Object record = pro.getProperty(dFile.getName() + "_record_" + i); |
|
|
|
Object record = pro.getProperty(dFile.getName() + "_record_" + i); |
|
|
|
if (!isNewTask && record != null && Long.parseLong(record + "") > 0) { //如果有记录,则恢复下载
|
|
|
|
if (!isNewTask |
|
|
|
|
|
|
|
&& record != null |
|
|
|
|
|
|
|
&& Long.parseLong(record + "") > 0) { //如果有记录,则恢复下载
|
|
|
|
Long r = Long.parseLong(record + ""); |
|
|
|
Long r = Long.parseLong(record + ""); |
|
|
|
mCurrentLocation += r - startL; |
|
|
|
mCurrentLocation += r - startL; |
|
|
|
Log.d(TAG, "++++++++++ 线程_" + i + "_恢复下载 ++++++++++"); |
|
|
|
Log.d(TAG, "++++++++++ 线程_" + i + "_恢复下载 ++++++++++"); |
|
|
@ -176,7 +185,7 @@ public class DownLoadUtil { |
|
|
|
startL = r; |
|
|
|
startL = r; |
|
|
|
recordL[rl] = i; |
|
|
|
recordL[rl] = i; |
|
|
|
rl++; |
|
|
|
rl++; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
isNewTask = true; |
|
|
|
isNewTask = true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (isNewTask) { |
|
|
|
if (isNewTask) { |
|
|
@ -186,7 +195,8 @@ public class DownLoadUtil { |
|
|
|
if (i == (THREAD_NUM - 1)) { |
|
|
|
if (i == (THREAD_NUM - 1)) { |
|
|
|
endL = fileLength;//如果整个文件的大小不为线程个数的整数倍,则最后一个线程的结束位置即为文件的总长度
|
|
|
|
endL = fileLength;//如果整个文件的大小不为线程个数的整数倍,则最后一个线程的结束位置即为文件的总长度
|
|
|
|
} |
|
|
|
} |
|
|
|
DownloadEntity entity = new DownloadEntity(context, fileLength, downloadUrl, dFile, i, startL, endL); |
|
|
|
DownloadEntity entity = |
|
|
|
|
|
|
|
new DownloadEntity(context, fileLength, downloadUrl, dFile, i, startL, endL); |
|
|
|
DownLoadTask task = new DownLoadTask(entity); |
|
|
|
DownLoadTask task = new DownLoadTask(entity); |
|
|
|
tasks.put(i, new Thread(task)); |
|
|
|
tasks.put(i, new Thread(task)); |
|
|
|
} |
|
|
|
} |
|
|
@ -206,18 +216,25 @@ public class DownLoadUtil { |
|
|
|
failDownload("下载失败,返回码:" + code); |
|
|
|
failDownload("下载失败,返回码:" + code); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
failDownload("下载失败【downloadUrl:" + downloadUrl + "】\n【filePath:" + filePath + "】" + Util.getPrintException(e)); |
|
|
|
failDownload("下载失败【downloadUrl:" |
|
|
|
|
|
|
|
+ downloadUrl |
|
|
|
|
|
|
|
+ "】\n【filePath:" |
|
|
|
|
|
|
|
+ filePath |
|
|
|
|
|
|
|
+ "】" |
|
|
|
|
|
|
|
+ Util.getPrintException(e)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
} |
|
|
|
private void failDownload(String msg){ |
|
|
|
|
|
|
|
|
|
|
|
private void failDownload(String msg) { |
|
|
|
Log.e(TAG, msg); |
|
|
|
Log.e(TAG, msg); |
|
|
|
isDownloading = false; |
|
|
|
isDownloading = false; |
|
|
|
stopDownload(); |
|
|
|
stopDownload(); |
|
|
|
mListener.onFail(); |
|
|
|
mListener.onFail(); |
|
|
|
System.gc(); |
|
|
|
System.gc(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 多线程下载任务类,不能使用AsyncTask来进行多线程下载,因为AsyncTask是串行执行的,这种方式下载速度太慢了 |
|
|
|
* 多线程下载任务类,不能使用AsyncTask来进行多线程下载,因为AsyncTask是串行执行的,这种方式下载速度太慢了 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -225,24 +242,38 @@ public class DownLoadUtil { |
|
|
|
private static final String TAG = "DownLoadTask"; |
|
|
|
private static final String TAG = "DownLoadTask"; |
|
|
|
private DownloadEntity dEntity; |
|
|
|
private DownloadEntity dEntity; |
|
|
|
private String configFPath; |
|
|
|
private String configFPath; |
|
|
|
|
|
|
|
|
|
|
|
public DownLoadTask(DownloadEntity downloadInfo) { |
|
|
|
public DownLoadTask(DownloadEntity downloadInfo) { |
|
|
|
this.dEntity = downloadInfo; |
|
|
|
this.dEntity = downloadInfo; |
|
|
|
configFPath = dEntity.context.getFilesDir().getPath() + "/temp/" + dEntity.tempFile.getName() + ".properties"; |
|
|
|
configFPath = dEntity.context.getFilesDir().getPath() |
|
|
|
|
|
|
|
+ "/temp/" |
|
|
|
|
|
|
|
+ dEntity.tempFile.getName() |
|
|
|
|
|
|
|
+ ".properties"; |
|
|
|
} |
|
|
|
} |
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
@Override public void run() { |
|
|
|
long currentLocation = 0; |
|
|
|
long currentLocation = 0; |
|
|
|
try { |
|
|
|
try { |
|
|
|
Log.d(TAG, "线程_" + dEntity.threadId + "_正在下载【" + "开始位置 : " + dEntity.startLocation + ",结束位置:" + dEntity.endLocation + "】"); |
|
|
|
Log.d(TAG, "线程_" |
|
|
|
|
|
|
|
+ dEntity.threadId |
|
|
|
|
|
|
|
+ "_正在下载【" |
|
|
|
|
|
|
|
+ "开始位置 : " |
|
|
|
|
|
|
|
+ dEntity.startLocation |
|
|
|
|
|
|
|
+ ",结束位置:" |
|
|
|
|
|
|
|
+ dEntity.endLocation |
|
|
|
|
|
|
|
+ "】"); |
|
|
|
URL url = new URL(dEntity.downloadUrl); |
|
|
|
URL url = new URL(dEntity.downloadUrl); |
|
|
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); |
|
|
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); |
|
|
|
//在头里面请求下载开始位置和结束位置
|
|
|
|
//在头里面请求下载开始位置和结束位置
|
|
|
|
conn.setRequestProperty("Range", "bytes=" + dEntity.startLocation + "-" + dEntity.endLocation); |
|
|
|
conn.setRequestProperty("Range", |
|
|
|
|
|
|
|
"bytes=" + dEntity.startLocation + "-" + dEntity.endLocation); |
|
|
|
conn.setRequestMethod("GET"); |
|
|
|
conn.setRequestMethod("GET"); |
|
|
|
conn.setRequestProperty("Charset", "UTF-8"); |
|
|
|
conn.setRequestProperty("Charset", "UTF-8"); |
|
|
|
conn.setConnectTimeout(TIME_OUT * 4); |
|
|
|
conn.setConnectTimeout(TIME_OUT * 4); |
|
|
|
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"); |
|
|
|
conn.setRequestProperty("User-Agent", |
|
|
|
conn.setRequestProperty("Accept", "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"); |
|
|
|
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"); |
|
|
|
|
|
|
|
conn.setRequestProperty("Accept", |
|
|
|
|
|
|
|
"image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"); |
|
|
|
conn.setReadTimeout(TIME_OUT * 24); //设置读取流的等待时间,必须设置该参数
|
|
|
|
conn.setReadTimeout(TIME_OUT * 24); //设置读取流的等待时间,必须设置该参数
|
|
|
|
InputStream is = conn.getInputStream(); |
|
|
|
InputStream is = conn.getInputStream(); |
|
|
|
//创建可设置位置的文件
|
|
|
|
//创建可设置位置的文件
|
|
|
@ -295,7 +326,8 @@ public class DownLoadUtil { |
|
|
|
synchronized (DownLoadUtil.this) { |
|
|
|
synchronized (DownLoadUtil.this) { |
|
|
|
mStopNum++; |
|
|
|
mStopNum++; |
|
|
|
String location = String.valueOf(currentLocation); |
|
|
|
String location = String.valueOf(currentLocation); |
|
|
|
Log.i(TAG, "thread_" + dEntity.threadId + "_stop, stop location ==> " + currentLocation); |
|
|
|
Log.i(TAG, |
|
|
|
|
|
|
|
"thread_" + dEntity.threadId + "_stop, stop location ==> " + currentLocation); |
|
|
|
writeConfig(dEntity.tempFile.getName() + "_record_" + dEntity.threadId, location); |
|
|
|
writeConfig(dEntity.tempFile.getName() + "_record_" + dEntity.threadId, location); |
|
|
|
if (mStopNum == THREAD_NUM) { |
|
|
|
if (mStopNum == THREAD_NUM) { |
|
|
|
Log.d(TAG, "++++++++++++++++ onStop +++++++++++++++++"); |
|
|
|
Log.d(TAG, "++++++++++++++++ onStop +++++++++++++++++"); |
|
|
@ -353,10 +385,9 @@ public class DownLoadUtil { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 将记录写入到配置文件 |
|
|
|
* 将记录写入到配置文件 |
|
|
|
* |
|
|
|
|
|
|
|
* @param record |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void writeConfig(String key, String record) throws IOException { |
|
|
|
private void writeConfig(String key, String record) throws IOException { |
|
|
|
File configFile = new File(configFPath); |
|
|
|
File configFile = new File(configFPath); |
|
|
@ -365,6 +396,7 @@ public class DownLoadUtil { |
|
|
|
Util.saveConfig(configFile, pro); |
|
|
|
Util.saveConfig(configFile, pro); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 子线程下载信息类 |
|
|
|
* 子线程下载信息类 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -377,7 +409,9 @@ public class DownLoadUtil { |
|
|
|
long endLocation; |
|
|
|
long endLocation; |
|
|
|
File tempFile; |
|
|
|
File tempFile; |
|
|
|
Context context; |
|
|
|
Context context; |
|
|
|
public DownloadEntity(Context context, long fileSize, String downloadUrl, File file, int threadId, long startLocation, long endLocation) { |
|
|
|
|
|
|
|
|
|
|
|
public DownloadEntity(Context context, long fileSize, String downloadUrl, File file, |
|
|
|
|
|
|
|
int threadId, long startLocation, long endLocation) { |
|
|
|
this.fileSize = fileSize; |
|
|
|
this.fileSize = fileSize; |
|
|
|
this.downloadUrl = downloadUrl; |
|
|
|
this.downloadUrl = downloadUrl; |
|
|
|
this.tempFile = file; |
|
|
|
this.tempFile = file; |
|
|
@ -390,53 +424,43 @@ public class DownLoadUtil { |
|
|
|
|
|
|
|
|
|
|
|
public static class DownloadListener implements IDownloadListener { |
|
|
|
public static class DownloadListener implements IDownloadListener { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onResume(long resumeLocation) { |
|
|
|
public void onResume(long resumeLocation) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onCancel() { |
|
|
|
public void onCancel() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onFail() { |
|
|
|
public void onFail() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onPreDownload(HttpURLConnection connection) { |
|
|
|
public void onPreDownload(HttpURLConnection connection) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onProgress(long currentLocation) { |
|
|
|
public void onProgress(long currentLocation) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onChildComplete(long finishLocation) { |
|
|
|
public void onChildComplete(long finishLocation) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onStart(long startLocation) { |
|
|
|
public void onStart(long startLocation) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onChildResume(long resumeLocation) { |
|
|
|
public void onChildResume(long resumeLocation) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onStop(long stopLocation) { |
|
|
|
public void onStop(long stopLocation) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override public void onComplete() { |
|
|
|
public void onComplete() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|