Fixed NullPointerException in bindToService
This commit is contained in:
parent
bdb6e008aa
commit
acce72d71b
|
@ -92,7 +92,7 @@ public class PlaybackService extends Service {
|
||||||
public static final int NOTIFICATION_TYPE_BUFFER_END = 6;
|
public static final int NOTIFICATION_TYPE_BUFFER_END = 6;
|
||||||
|
|
||||||
/** Is true if service is running. */
|
/** Is true if service is running. */
|
||||||
public static boolean isRunning;
|
public static boolean isRunning = false;
|
||||||
|
|
||||||
private static final int NOTIFICATION_ID = 1;
|
private static final int NOTIFICATION_ID = 1;
|
||||||
private NotificationCompat.Builder notificationBuilder;
|
private NotificationCompat.Builder notificationBuilder;
|
||||||
|
|
|
@ -149,7 +149,7 @@ public abstract class PlaybackController {
|
||||||
if (AppConfig.DEBUG)
|
if (AppConfig.DEBUG)
|
||||||
Log.d(TAG,
|
Log.d(TAG,
|
||||||
"PlaybackService is running, trying to connect without start command.");
|
"PlaybackService is running, trying to connect without start command.");
|
||||||
bound = activity.bindService(serviceIntent, mConnection, 0);
|
bound = activity.bindService(new Intent(activity, PlaybackService.class), mConnection, 0);
|
||||||
}
|
}
|
||||||
if (AppConfig.DEBUG)
|
if (AppConfig.DEBUG)
|
||||||
Log.d(TAG, "Result for service binding: " + bound);
|
Log.d(TAG, "Result for service binding: " + bound);
|
||||||
|
|
Loading…
Reference in New Issue