내 응용 프로그램에서 화면 방향이 바뀔 때 경고 대화 상자가 표시되고 닫힙니다. 어떻게 해결할 수 있을까요? 내 코드는 아래와 같습니다.화면 방향이 변경되면 AlertDialogue가 파괴됩니다.
private void showDialogue() {
AlertDialog.Builder alert = new AlertDialog.Builder(MyClass.this);
alert.setTitle("Title");
alert.setIcon(R.drawable.icon);
LayoutInflater inflater = (LayoutInflater)MyClass.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.dialogue, null, false);
EditText from= (EditText)view.findViewById(R.id.from);
EditText to= (EditText)view.findViewById(R.id.to);
from.setHint("eg : From");
to.setHint("eg : To");
alert.setView(view);
searchAlert = alert.create();
searchAlert.show();
}