안녕하세요.. 이것저것해봐도 안되서 질문드립니다 ...
메인엑티비티를 A 라고하고 B 하고 C 엑티비티가있다고하면
A에서
findViewById(R.id.btn1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, B.class);
startActivity(intent);
startActivity(intent);
}
});
이렇게 B엑티비티로넘어가서
B엑티비티 Oncreate 부분에
밑에있는 스레드 클레스를
객체생성후 실행시켰습니다 이부분이 B엑티비티에서는 잘 실행되는데
위 코드에서 B를 C 로바꾸고 C엑티비티로 넘어가서 똑같이했는데
되지않습니다...
제가 액티비티생성할때 잘못한것인가요?..
초보자에게 답변좀 부탁드립니다 ㅠㅠㅠ
class timethread1 extends Thread {
private int i = 1;
private boolean tf = true;
public void run() {
super.run();
while (tf) {
try {
while (tf) {
myHandler.post(new Runnable() {
@Override
public void run() {
if (i == 1) {
realnum = session.getString("realnum", "");
textrealtime.setVisibility(View.INVISIBLE);
i = 2;
} else if (i == 2) {
textrealtime.setVisibility(View.VISIBLE);
i = 1;
}
}
});
Thread.sleep(5000);
}
} catch (Exception ex) {
Log.e("timethread", "Exception in timethread.", ex);
}
}
}
}