开发者

Hide/Show custom dialog in Android

开发者 https://www.devze.com 2023-02-24 23:47 出处:网络
I have a custom dialog which is non-modal. In my screen i have custom dialog and few other UI elements. user taps on开发者_运维知识库 the dialog and it is shown. Now i want to handle a scenario where

I have a custom dialog which is non-modal. In my screen i have custom dialog and few other UI elements. user taps on开发者_运维知识库 the dialog and it is shown. Now i want to handle a scenario where if he/she clicks anywhere on other UI elements i want to hide the dialog.

Is it possible ?


Add a listener to the UI element and use this when a user clicks it.

public final void dismissDialog (int id)

Since: API Level 1 Dismiss a dialog that was previously shown via showDialog(int). Parameters

id The id of the managed dialog.

0

精彩评论

暂无评论...
验证码 换一张
取 消