Fix start streaming
This commit is contained in:
parent
39628473fe
commit
f997e8b687
|
@ -4967,20 +4967,25 @@ public class Helper {
|
||||||
|
|
||||||
public static void startStreaming(Context context) {
|
public static void startStreaming(Context context) {
|
||||||
int liveNotifications = Helper.liveNotifType(context);
|
int liveNotifications = Helper.liveNotifType(context);
|
||||||
|
Intent streamingIntent = null;
|
||||||
switch (liveNotifications){
|
switch (liveNotifications){
|
||||||
case Helper.NOTIF_LIVE:
|
case Helper.NOTIF_LIVE:
|
||||||
Intent streamingIntent = new Intent(context, LiveNotificationService.class);
|
streamingIntent = new Intent(context, LiveNotificationService.class);
|
||||||
try {
|
|
||||||
context.startService(streamingIntent);
|
|
||||||
}catch (Exception ignored){}
|
|
||||||
break;
|
break;
|
||||||
case Helper.NOTIF_DELAYED:
|
case Helper.NOTIF_DELAYED:
|
||||||
streamingIntent = new Intent(context, LiveNotificationDelayedService.class);
|
streamingIntent = new Intent(context, LiveNotificationDelayedService.class);
|
||||||
try {
|
|
||||||
context.startService(streamingIntent);
|
|
||||||
}catch (Exception ignored){}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if( streamingIntent != null) {
|
||||||
|
try {
|
||||||
|
if (Build.VERSION.SDK_INT >= 26) {
|
||||||
|
context.startForegroundService(streamingIntent);
|
||||||
|
} else {
|
||||||
|
context.startService(streamingIntent);
|
||||||
|
}
|
||||||
|
context.startService(streamingIntent);
|
||||||
|
} catch (Exception ignored) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue