gpt4 book ai didi

android - 我尝试在教程中的 setFlags 中使用这个标志,但它已被弃用,我该怎么办

转载 作者:行者123 更新时间:2023-11-29 14:46:47 26 4
gpt4 key购买 nike

FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET 已弃用;那我应该怎么用呢?

private Intent createShareForecastIntent() {

Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, mforecastStr + FORECAST_SHARE_HASHTAG);
return shareIntent;


}

最佳答案

引用 the documentation :

As of API 21 this performs identically to FLAG_ACTIVITY_NEW_DOCUMENT which should be used instead of this.

由于两个符号具有相同的数值 (0x00080000),因此就运行时行为而言,使用哪一个并不重要。如果您的 compileSdkVersion 为 21 或更高,请切换到 FLAG_ACTIVITY_NEW_DOCUMENT

关于android - 我尝试在教程中的 setFlags 中使用这个标志,但它已被弃用,我该怎么办,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33179042/

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