Some Times we don't need to cancle alert when user click on outside dialog. At this time use below code in your activity oncreate() method after setContentView()
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.demolayout);
//Dialog should not be canceled
this.setFinishOnTouchOutside(false);
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.demolayout);
//Dialog should not be canceled
this.setFinishOnTouchOutside(false);
}
No comments:
Post a Comment