I tried using this Flag in setFlags from tutorial but its deprecated, what do i do
问题 FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET is deprecated; so what should I use? 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; } 回答1: Quoting the documentation: As of API 21 this performs identically to FLAG_ACTIVITY_NEW_DOCUMENT which should be used