Skip to content

Commit

Permalink
action button flag bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FatihUtkuKara committed Jan 12, 2024
1 parent 09be2c1 commit d4d5f34
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,22 @@ private NotificationCompat.Builder createNotificationBuilder(Context context,
if (actions != null && !actions.isEmpty()) {
for (Actions actionItem : actions) {
Uri linkUri = Uri.parse(actionItem != null ? actionItem.getUrl() : "");
PendingIntent actionIntent = PendingIntent.getActivity(
context,
0,
new Intent(Intent.ACTION_VIEW, linkUri),
PendingIntent.FLAG_UPDATE_CURRENT
);
PendingIntent actionIntent ;
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.R){
actionIntent =(PendingIntent.getActivity(
context,
0,
new Intent(Intent.ACTION_VIEW, linkUri),
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE));
}
else {
actionIntent = (PendingIntent.getActivity(
context,
0,
new Intent(Intent.ACTION_VIEW, linkUri),
PendingIntent.FLAG_UPDATE_CURRENT ));
}


int actionIcon = R.drawable.ic_carousel_icon;
if (actionItem != null && !actionItem.getIcon().isEmpty()) {
Expand Down

0 comments on commit d4d5f34

Please sign in to comment.