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);
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);
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
.
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With