AppStateHelper

object AppStateHelper

Types

Message
Link copied to clipboard
enum Message : Enum<AppStateHelper.Message>

Functions

activityStarting
Link copied to clipboard
fun activityStarting(activity: Activity): Boolean
Activity 执行到 onStart 时调用,需主动调用
activityStopping
Link copied to clipboard
@Synchronized()
fun activityStopping(activity: Activity): Boolean
Activity 执行到 onStop 时调用,需主动调用
addListener
Link copied to clipboard
fun addListener(listener: OnAppStateChangedListener)
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
onBackground
Link copied to clipboard
private fun onBackground(activity: Activity)
onForeground
Link copied to clipboard
private fun onForeground(activity: Activity)
removeListener
Link copied to clipboard
fun removeListener(listener: OnAppStateChangedListener)
toString
Link copied to clipboard
open fun toString(): String

Properties

activityCount
Link copied to clipboard
private var activityCount: Int = 0
isBackground
Link copied to clipboard
val isBackground: Boolean
判断 App 当前是否为后台不可见状态
isForeground
Link copied to clipboard
val isForeground: Boolean
判断 App 当前是否为前台可见状态
listeners
Link copied to clipboard
private val listeners: MutableList<OnAppStateChangedListener>
state
Link copied to clipboard
val state: AppStateHelper.Message
返回当前的App状态