19 lines
335 B
Kotlin
19 lines
335 B
Kotlin
package com.gh.base
|
|
|
|
import android.app.Activity
|
|
|
|
object CurrentActivityHolder {
|
|
|
|
@JvmStatic
|
|
val activitySet = HashSet<Activity>()
|
|
|
|
@JvmStatic
|
|
fun getCurrentActivity(): Activity? {
|
|
return if (activitySet.isEmpty()) {
|
|
null
|
|
} else {
|
|
activitySet.iterator().next()
|
|
}
|
|
}
|
|
|
|
} |