作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
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/
我是一名优秀的程序员,十分优秀!