Skip to content

Commit

Permalink
Open the app on clicking notification (jhomlala#420)
Browse files Browse the repository at this point in the history
Co-authored-by: shashikantdurge <shashikant@leher.ai>
  • Loading branch information
shashikantdurge and shashikantleher authored Apr 13, 2021
1 parent 61658fc commit 368ad8a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,14 @@ public String getCurrentContentTitle(@NonNull Player player) {
@Nullable
@Override
public PendingIntent createCurrentContentIntent(@NonNull Player player) {
return null;
final String packageName = context.getApplicationContext().getPackageName();
Intent notificationIntent = new Intent();
notificationIntent.setClassName(packageName,
packageName + ".MainActivity");
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
return PendingIntent.getActivity(context, 0,
notificationIntent, 0);
}

@Nullable
Expand Down

0 comments on commit 368ad8a

Please sign in to comment.