跳转Activity时清除当前Activity

    void GotoMainActivity(){
        Intent intent = new Intent(ProductionInformationActivity.this, MainActivity.class);
        //跳到MainActivity时清除掉ProductionInformationActivity
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    }

 

posted on 2019-04-17 16:50  赵子隆  阅读(899)  评论(0编辑  收藏  举报

导航