Prevent Android activity dialog from closing on outside touch

Dialog dialog = new AlertDialog.Builder(this)
                    .setTitle("Connection Failed")
                    .setMessage("Tying to connect server, please check your network.")
                    .setIcon(android.R.drawable.ic_dialog_alert)
                    .create();
       dialog.setCanceledOnTouchOutside(false);
       dialog.show();

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *