findActivityOf

inline fun <T : Activity> Context.findActivityOf(): T?

Traverses the ContextWrapper chain to find a specific subtype of Activity.

Example usage: context.findActivity<ComponentActivity>()

Return

The Activity of type T, or null if not found.