の進行状況を、別のクラスから取得した値でActivity更新する必要があります。ProgressBar
ダウンロードクラスでは、この関数を使用して進行状況を計算しました..
public void publishDownloadProgress(long lengthoffile, long bytesDownloaded){
mFileLength = lengthoffile;
totalBytesDownloaded = bytesDownloaded;
mProgress = ((totalBytesDownloaded*100)/mFileLength);
}
そしてこれは進歩を得るために
public long getDownloadProgress(){
return mProgress;
}
しかし、私が使用するときgetDownloadProgress(); 私のActivityでは、一度しか取得できないため、0理解できるものだけを取得します。
しかし、代わりに私が気に入っているのは、更新したい一連の継続的な進行状況の値ProgressBarです。それを行う方法は?