Issue
This is the code -
if (Build.VERSION.SDK_INT >= 31) {
Intent intent=new Intent(launcher.this,MainActivity.class);
startActivity(intent);
finish();
}
I am getting this error- Console error-
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
Solution
Just add this library in your gradle...
implementation 'androidx.work:work-runtime-ktx:2.7.0-alpha05'
Work for me...
Answered By - Jay Panchal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.