gpt4 book ai didi

android - 找不到符号变量 FLAG_ACTIVITY_CLEAR_TASK

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:53:53 29 4
gpt4 key购买 nike

将支持版本更新到 27.0.0 编译器后出现错误

找不到符号变量 FLAG_ACTIVITY_CLEAR_TASK

Is this variable removed? What use instead?

代码示例:

 Intent intent = new Intent(SetNewPasswordActivity.this, SignInActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);

最佳答案

cannot find symbol variable FLAG_ACTIVITY_CLEAR_TASK

你应该使用 Intent.FLAG_ACTIVITY_CLEAR_TASK .

If set in an Intent passed to Context.startActivity(), this flag will cause any existing task that would be associated with the activity to be cleared before the activity is started.

intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);

关于android - 找不到符号变量 FLAG_ACTIVITY_CLEAR_TASK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47070471/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com