tasvirlar soni 1 dan ortiq bo'lmagan joyda yuklab olish progress muloqotini amalga oshiradi

Vaqt o'tishi bilan serverlardan yuklab olish jarayoni ko'rsatiladi. Men rasmlarni yuklab olish va taraqqiyot muloqotini amalga oshirish imkoniyatiga ega bo'laman, ammo mening muammom progress muloqotining ishdan bo'shatilmasligini va faqat oxirgi olingan tasvirni ko'rsatadi.

Buning uchun quyidagi kodni ishlataman:

         public class BackgroundAsyncTask extends AsyncTask {

    int myProgress;


    @Override
    protected void onPostExecute(Bitmap result) {
        image.setVisibility(View.VISIBLE);
        image.setImageBitmap(result);
        if(dialog.isShowing())
        {
            dialog.dismiss();

        }
         return;
    }



    protected void onPreExecute() {
            dialog = ProgressDialog.show(ProfilePageNormalUser.this,
                "Loading...", "Please wait...");
    }

    @Override
    protected Bitmap doInBackground(String... paths) {
        return DownloadFile(imageUrl);


    }

    @Override
    protected void onProgressUpdate(Integer... values) {
       //TODO Auto-generated method stub
        progressBar.setProgress(values[0]);
    }

}

va ularni chaqirishga quyidagilar kiradi:

      new BackgroundAsyncTask().execute(imageUrl);

Muammo nima bo'lishi mumkin menga kimdir baland bo'yli bo'lishi mumkinmi? Rahmat

0

1 javoblar

publishProgress() deb nomlashingiz kerak. > Har bir rasmdan keyin. publishProgress() keyin UI ish zarrachalaridan onProgressUpdate() deb nomlanadi.

0
qo'shib qo'ydi