FxRi4
FxRi4

Reputation: 1248

android ProgressBar updateing during download

in my file download app there is ListView that each row contain properties file and one ProgressBar for downloading status of it and i work with View Holder pattern but progress bar not update

@Override
    protected void onProgressUpdate(Long... values) {
        ProgressBar bar1;
        TextView status1;
        DownloadStructure.setProgress(values[0].intValue());
        bar1 = DownloadStructure.getProgressBarRefrence();
        if (bar1 != null) {
            bar1.setVisibility(View.VISIBLE);
            bar1.setMax(values[2].intValue());
            bar1.setProgress(DownloadStructure.getProgress());
            bar1.Invalidate();
        }
        status1 = DownloadStructure.getProgressTextviewRefrence();
        if (status1 != null) {
            status1.setVisibility(View.VISIBLE);
            status1.setText(DownloadStructure.getDownloadStatus());
            status1.postInvalidate();
        }
    }

Upvotes: 1

Views: 101

Answers (1)

FxRi4
FxRi4

Reputation: 1248

Try to call notifyDataSetChanged :

        protected void onPostExecute(Boolean result) {
            ...
            myListView.notifyDataSetChanged(); //or simply notifyDataSetChanged if your Async inside adapter
        }

Upvotes: 1

Related Questions