ContextUtils

Class containing static methods involving manipulations of Contexts and their related subclasses.

Functions

Link copied to clipboard
fun <T> findContextOfType(context: Context?, clazz: Class<out T>): T?

Returns the nearest context in the chain (as defined by ContextWrapper.getBaseContext()) which is an instance of the specified type, or null if one could not be found