android使用progressBar的时候,使用子线程修改进度的时候没有效果啊 代码如下 望高手解答 谢谢
publicclassDebugTestActivityextendsActivity{privateProgressBarpb;/**Calledwhentheacti...
public class DebugTestActivity extends Activity {
private ProgressBar pb;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
pb=(ProgressBar) findViewById(R.id.progressBar1);
System.out.println(pb.getProgress());
new Thread(){
@Override
public void run() {
System.out.println("zhixingle");
super.run();
pb.setProgress(10);
}
}.start();
}
} 展开
private ProgressBar pb;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
pb=(ProgressBar) findViewById(R.id.progressBar1);
System.out.println(pb.getProgress());
new Thread(){
@Override
public void run() {
System.out.println("zhixingle");
super.run();
pb.setProgress(10);
}
}.start();
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询