startActivity 新开一个Activity

    private void startActivity(Intent intent) {
        Context ctx = ApplicationController.getTopActivity();
        if (null == ctx) {
            ctx = ApplicationController.getApplication();
        }

        if (!(ctx instanceof Activity)) {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        ctx.startActivity(intent);
    }

 

posted on 2020-05-06 10:21  赵子隆  阅读(257)  评论(0编辑  收藏  举报

导航