В активности вызываю сервис
PendingIntent pi;
Intent intent;
Intent intent_empty = new Intent();
// Создаем PendingIntent
pi = createPendingResult(1 ,intent_empty, 0);
// Создаем Intent для вызова сервиса
// и созданный PendingIntent
intent = new Intent(this, VideoService.class).putExtra(PARAM_PINTENT, pi).putExtra(PARAM_FLAG, false);
// стартуем сервис
startService(intent);
Он не запускается. Вообще. Код сервиса:
public void onCreate() {
super.onCreate();
System.out.println("onStartCommand");
}
public int onStartCommand(Intent intent, int flags, int startId) {
System.out.println("onStartCommand");
mCamera = getCameraInstance();
mPreview = new CameraPreview(this, mCamera);
boolean flag = intent.getBooleanExtra(VideoR.PARAM_FLAG, false);
PendingIntent pi = intent.getParcelableExtra(VideoR.PARAM_PINTENT);
if (!flag) {
startRecord(pi);
}
else {
stopRecord(pi);
}
return super.onStartCommand(intent, flags, startId);
}
public void onDestroy() {
super.onDestroy();
Log.d(LOG_TAG, "onDestroy");
}
public IBinder onBind(Intent intent) {
Log.d(LOG_TAG, "onBind");
return null;
}