Skip to content

Activity Management

ActivityUtils is responsible for managing Activity.

Add Activity

ActivityUtils. addActivity(this@MainActivity)

Remove Activity

ActivityUtils. removeActivity(this@MainActivity)

Get the corresponding Activity according to the given Class

ActivityUtils.getActivity(MainActivity::class.java)

Find the available Activity at the top of the stack

ActivityUtils. getCurrentActivity()

Get all stored activities

val activities = ActivityUtils. getActivities()

End all activities

ActivityUtils. finishAllActivity()

Exit App

ActivityUtils. exitApp()