안드로이드 개발 질문/답변
(글 수 45,052)
public class level1 extends Activity{
public int clears = 0;
}
이렇게 맨 처음 맨위에 선언을 했습니다.
if(v.getId()==R.id.block1_13){
clears=0;
current=13;
setContentView(R.layout.level1_13);
Button btn1=(Button)findViewById(R.id.b1_4_1);
btn1.setOnClickListener(this);
pgbar();
}
여기서
public void pgbar(){
new Thread(){
public void run() {
countr=0;
while ( countr < 100 ) {
try {Thread.sleep(100);}catch(Exception e){}
barHandler.post(new Runnable() {
public void run(){
bars.setProgress(countr);
int a = clears;
if(countr==100)
tf(13,a);
}
});
countr++;
}
}
}.start();
}
이렇게 프로그래스 바를 생성했습니다.
그리고
if(v.getId()==R.id.b1_4_1){
corrent++
}
이렇게 했는데 current 가 ++되지 않고
밑에서
private void tf(int a, int b){
if(a==current){
fail();
}
}
fail이 됩니다.
문제가 뭘까요...
전혀 모르겠어요..
왜 current 에 ++가 적용이 안되는건가요?
혹시 public, static, private 이런 앞에 선언이 잘못 들어가면 안먹는거나 그런건 아니죠?




if(countr==100) << if(counter >= 99)