Android – progress bar passing floating point parameters

I try to build a progress bar in Android, because you know that the progress bar gets the int of the progress, but I need to pass the float to the progress bar. What should I do?

private Runnable myThread = new Runnable(){  
    @Override
    public void run() {
                mypb = mypb + 100 / time;
                pb.setProgress(mypb);
    }
};

resolvent:

However, you can convert floating values to ints in the following ways

 pb.setProgress((int)mypb);

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>