NONAME
NONAME

Reputation: 27

Exit the activity without closing the dialog

I'm preventing the dialog box from closing when I press the activity back button. When you press the back button, the dialog should exit without closing. Dialog.setCancelable(false); I tried this, but it makes the back button unstoppable when the dialog opens. I hope I was able to explain the question. Please help me.

Or close the dialog at the same time and exit Activity?

Upvotes: 1

Views: 123

Answers (1)

AZİZ KARATAS
AZİZ KARATAS

Reputation: 33

It is not possible to do it in the same main thread. Because the work done in the activity started according to the life cycle is stopped and you can try to use more fragments management in the same activity. If you can explain why you need it, I can give you an idea.

https://developer.android.com/guide/components/activities/activity-lifecycle

Upvotes: 1

Related Questions