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.
Comments
Post a Comment