Reputation: 2806
After updating support version to 27.0.0 compiler giving error
cannot find symbol variable FLAG_ACTIVITY_CLEAR_TASK
.
Is this variable removed? What use instead?
code example:
Intent intent = new Intent(SetNewPasswordActivity.this, SignInActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
Upvotes: 6
Views: 3205
Reputation: 166
IntentCompat.FLAG_ACTIVITY_CLEAR_TASK
is deprecated thus please use Intent.FLAG_ACTIVITY_CLEAR_TASK
directly.
This flag can only be used in conjunction with #FLAG_ACTIVITY_NEW_TASK
.
Upvotes: 2
Reputation: 1024
IntentCompat.FLAG_ACTIVITY_CLEAR_TASK
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
Upvotes: 0
Reputation: 69709
use this
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
instead of this
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
Upvotes: 1
Reputation: 5705
IntentCompat doesn't have any flag like FLAG_ACTIVITY_CLEAR_TASK
.
You should use Intent instead.
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
Upvotes: 0
Reputation: 75788
cannot find symbol variable FLAG_ACTIVITY_CLEAR_TASK
You should use 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);
Upvotes: 15