android - how to display current progress on progress bar when activity comes to foreground -


i using progress bar displaying status of data download server using asynktask.

i have written callback method update progress

@override public void onbookdownloadprogressupdated(int value)  {     if(_bookprogressbar == null)     {         linearlayout linearlayout = (linearlayout) latestlinearlayout.findviewwithtag(layouttagqueue.peek());         _bookprogressbar = (progressbar) linearlayout.getchildat(1);     }     _bookprogressbar.setprogress(value); } 

this works fine.but when user goes screen , coming screen progress bar didn't show progress while downloading going on in background. how show current progress user press key , revisit screen.

try using below link progress bar , put method set value of progress bar in onresume() instead of oncreate() or onstart().

use static variable(int) showing progress of progressbar.

download file android, , showing progress in progressdialog


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -