Skip to content

一个管理所有Activity的库,可以任意处关闭任意Activity

License

Notifications You must be signed in to change notification settings

xiandanin/ActivityManager

Repository files navigation

ActivityManager

一个管理所有Activity的库,可以在任意处关闭任意Activity

Gradle引入

compile 'com.dyhdyh:activity-manager:1.0.0'

在Application注册

public class ExampleApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        //注册管理器
        ActivityManager.getInstance().register(this);
}

示例

//关闭栈顶Activity
ActivityManager.getInstance().finishTopActivity();

//关闭所有BActivity,CActivity
ActivityManager.getInstance().finishActivity(BActivity.class, CActivity.class);

//保留DActivity,其余全部关闭
ActivityManager.getInstance().finishAllActivityByWhitelist(DActivity.class);

//关闭所有Activity
ActivityManager.getInstance().finishAllActivity();

示例apk

点击下载

About

一个管理所有Activity的库,可以任意处关闭任意Activity

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages