Fixed NullPointerException in bindToService

This commit is contained in:
daniel oeh 2012-09-10 16:35:44 +02:00
parent bdb6e008aa
commit acce72d71b
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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);