de.unikassel.android.sdcframework.service
Class ServiceRunningStateListener

Package class diagram package ServiceRunningStateListener
java.lang.Object
  extended by android.content.BroadcastReceiver
      extended by de.unikassel.android.sdcframework.service.ServiceRunningStateListener

public abstract class ServiceRunningStateListener
extends BroadcastReceiver

The broadcast receiver for the SDCService running state.
As the service running state changes will be signaled by broadcasted intents, this listener is used to track the state changes in the service control activity .


Field Summary
private  String action
          the action string for the intent
 
Constructor Summary
ServiceRunningStateListener(String action)
          Constructor
 
Method Summary
 void onReceive(Context context, Intent intent)
           
protected abstract  void serviceStateChanged(boolean isRunning)
          Running state change handler
 
Methods inherited from class android.content.BroadcastReceiver
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

action

private final String action
the action string for the intent

Constructor Detail

ServiceRunningStateListener

public ServiceRunningStateListener(String action)
Constructor

Parameters:
action - the action string of the intent to listen for
Method Detail

onReceive

public void onReceive(Context context,
                      Intent intent)
Specified by:
onReceive in class BroadcastReceiver

serviceStateChanged

protected abstract void serviceStateChanged(boolean isRunning)
Running state change handler

Parameters:
isRunning - flag if the service is running