0
ToggleButton
을 눌렀을 때 새로운 활동을 시작하려면 어떻게해야합니까? 여기에 지금까지 무엇을 가지고 :android 어떻게 토글 버튼에서 새로운 활동을 호출?
public static boolean status = false;
final ToggleButton yes_no = (ToggleButton) findViewById(R.id.yes_no);
yes_no.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (status == true) {
if ((yes_no.isPressed())) {
startActivity(new Intent(MainActivity.this,UserFeedback.class));
} else if (status) {
if (yes_no.isPressed()) {
startActivity(new Intent(MainActivity.this,QuestionScreen.class));
}
}
}
}
});
적절한 텍스트를 작성하고 코드를 올바르게 형식화하십시오. 이렇게하면 문제를 더 쉽게 이해할 수 있습니다. – Bugfinger