INNER CODE UNIT · Java
showNotification
SkyTubeTeam/SkyTube · app/src/main/java/free/rm/skytube/app/FeedUpdateTask.java:135
private void showNotification() {
final Context context = SkyTubeApp.getContext();
final NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_notification_icon)
.setContentTitle(context.getString(R.string.fetching_subscription_videos))
.setContentText(String.format(context.getString(R.string.fetched_videos_from_channels),
numVideosFetched, numChannelsFetched, numChannelsSubscribed));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
Log.e(TAG, "Pending intent call?");
PendingIntent pendingIntent = PendingIntentCompat.getActivity(context,
1, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT, false);
builder.setPriority(NotificationCompat.FLAG_ONGOING_EVENT)
.setContentIntent(pendingIntent);
}