popup
대화 상자를 만드는 내 main.class
파일에 간단한 코드 텍스트가 있습니다. finish();
메서드로 popupdialog를 닫으려고하면 팝업 대화 상자뿐만 아니라 전체 응용 프로그램이 종료됩니다. 어떻게 해결할 수 있을까요? (이것은 안드로이드를위한 것입니다, 아래 내 의견을보십시오).팝업 대화 상자를 닫는 방법?
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.start_dialog);
dialog.setTitle("This is my custom dialog box");
dialog.setCancelable(true);
//there are a lot of settings, for dialog, check them all out!
//set up text
TextView text = (TextView) dialog.findViewById(R.id.TextView01);
text.setText(R.string.loss);
//set up image view
ImageView img = (ImageView) dialog.findViewById(R.id.ImageView01);
img.setImageResource(R.drawable.golf_ball);
//set up button
Button button = (Button) dialog.findViewById(R.id.Button01);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
//now that the dialog is set up, it's time to show it
dialog.show();
어떤 프로그래밍 언어/OS/환경/무엇입니까? –
숙제 질문 ... –
android mobile (JAVA). – jesmar