DialogCompat

Added in 1.1.0

public class DialogCompat


Helper for accessing features in android.app.Dialog in a backwards compatible fashion.

Summary

Public methods

static @NonNull View
requireViewById(@NonNull Dialog dialog, int id)

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 show or create).

Public methods

requireViewById

Added in 1.1.0
public static @NonNull View requireViewById(@NonNull Dialog dialog, int id)

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 show or 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
@NonNull Dialog dialog

the Dialog to search the View in

int id

the ID to search for

Returns
@NonNull View

a view with given ID