how to start background services using broadcast receiver. made one services for camera lock operation but after some time function is not working . service is running in android devices. but method of services in onstartcommand not working.
used action.user_present but its not working .
public class camerareceiver extends BroadcastReceiver{
public static String TESTACT_S = "android.intent.action.USER_PRESENT";
@Override
public void onReceive(Context context, Intent intent) {
if(intent.getAction().equals(TESTACT_S))
{ context.startService(newIntent("com.simsys.camera.ServiceTemplate")); } }