createWithResource

@NonNull
open fun createWithResource(@NonNull context: @NonNull Context, @DrawableRes resId: Int): @NonNull IconCompat(source)

Create an Icon pointing to a drawable resource.

Parameters

context

The context for the application whose resources should be used to resolve the given resource ID.

resId

ID of the drawable resource

See also


open fun createWithResource(@Nullable r: @Nullable Resources, @NonNull pkg: @NonNull String, @DrawableRes resId: Int): @NonNull IconCompat(source)