This might fix the missing progress bar #155
setVisibility(Public) is only available since Lollipop.
This commit is contained in:
parent
1c3e0b628b
commit
7f8ba83aab
|
@ -51,14 +51,17 @@ public class GB {
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
|
||||||
notificationIntent, 0);
|
notificationIntent, 0);
|
||||||
|
|
||||||
return new NotificationCompat.Builder(context)
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
|
||||||
.setVisibility(Notification.VISIBILITY_PUBLIC)
|
builder.setContentTitle(context.getString(R.string.app_name))
|
||||||
.setContentTitle(context.getString(R.string.app_name))
|
|
||||||
.setTicker(text)
|
.setTicker(text)
|
||||||
.setContentText(text)
|
.setContentText(text)
|
||||||
.setSmallIcon(R.drawable.ic_notification)
|
.setSmallIcon(R.drawable.ic_notification)
|
||||||
.setContentIntent(pendingIntent)
|
.setContentIntent(pendingIntent)
|
||||||
.setOngoing(true).build();
|
.setOngoing(true);
|
||||||
|
if (GBApplication.isRunningLollipopOrLater()) {
|
||||||
|
builder.setVisibility(Notification.VISIBILITY_PUBLIC);
|
||||||
|
}
|
||||||
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateNotification(String text, Context context) {
|
public static void updateNotification(String text, Context context) {
|
||||||
|
|
Loading…
Reference in New Issue