对进度100%,开始新的活动 [英] start new activity on progressbar 100%
本文介绍了对进度100%,开始新的活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用这个教程来创建自定义的进度和它的作品。
I use this Tutorial to create custom Progressbar and it works .
不过,我想,当进度条到100%,开始新的活动。
But I want to start new activity when progress bar go to 100% .
任何人都可以帮助摆在正确的位置开始新的活动code?
anyone can help to put start new activity code in correct place?
推荐答案
您可以检查进度已经达到了最大可能,当你设置它,就像这样:
You can check if the progress has reached the maximum possible while you're setting it, like this:
@Override
public synchronized void setProgress(int progress) {
super.setProgress(progress);
// the setProgress super will not change the details of the progress bar
// anymore so we need to force an update to redraw the progress bar
invalidate();
if(progress >= getMax()) {
Intent intent....
}
}
这篇关于对进度100%,开始新的活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文