AndroidDev AndroidDev - 2 days ago 5
Android Question

Android Progress Bar Listener

Is there anyway to know when a progressbar has reached it maximum. Like a Listener then could plug into the ProgressBar and lets us know that the progress bar is at the maximum level ?

Kind Regards


There isn't a direct way to do this. A workaround could be to make a custom implementation of the ProgressBar and override the setProgress method:

public MyProgressBar extends ProgressBar
   public void setProgress(int progress)
       if(progress == this.getMax())
           //Do stuff when progress is max