Mark Yoon
Mark Yoon

Reputation: 380

Android Dialog out of dialog click

I made a custom dialog (extends Dialog) and then make the object in Activity Sample.class

Then if I click one button in the Activity and the custom dialog shows up.

Here, the problem is, since the custom dialog contains the EditText, the soft keyboard is needed and it shows up, but if I click(tab) the screen outside of the dialog, the "cancel" listener is called so that the dialog is disappeared. However, what I want to implement is when I click the screen outside of the dialog, only just keyboard disappearing. Can anyone help me?

Upvotes: 0

Views: 70

Answers (2)

Akshay Shinde
Akshay Shinde

Reputation: 947

use this,
dialog.setCanceledOnTouchOutside(false);

Upvotes: 0

siva
siva

Reputation: 1858

Use setCanceledOnTouchOutside(false) on the dialog instance. This will stop dismissing the dialog. But I am not sure the soft keypad will go away with this.

Upvotes: 1

Related Questions