DialogCompat
open class DialogCompat
kotlin.Any | |
↳ | androidx.core.app.DialogCompat |
Helper for accessing features in android.app.Dialog
in a backwards compatible fashion.
Summary
Public methods | |
---|---|
open static View |
requireViewById(@NonNull dialog: Dialog, id: Int) Finds the first descendant view with the given ID or throws an IllegalArgumentException if the ID is invalid (< 0), there is no matching view in the hierarchy, or the dialog has not yet been fully created (for example, via |
Public methods
requireViewById
@NonNull open static fun requireViewById(
@NonNull dialog: Dialog,
id: Int
): View
Finds the first descendant view with the given ID or throws an IllegalArgumentException if the ID is invalid (< 0), there is no matching view in the hierarchy, or the dialog has not yet been fully created (for example, via android.app.Dialog#show()
or android.app.Dialog#create()
).
Note: In most cases -- depending on compiler support -- the resulting view is automatically cast to the target class type. If the target class type is unconstrained, an explicit cast may be necessary.
Parameters | |
---|---|
dialog |
Dialog: the Dialog to search the View in |
id |
Int: the ID to search for |
Return | |
---|---|
View |
a view with given ID |