因为我刚开始使用Android编码,所以我犹豫是否发布了我的问题,但现在我正处于无法抗拒的地步.
我有一项服务打开摄像头LED onCreate:
@Override
public void onCreate() {
// make sure we don't sleep
this.pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
this.mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "SleepLED");
this.mTimer = new Timer();
this.mTimerTask = new TimerTask() {
public void run() {
// turn on the LED
setFlashlight(Camera.Parameters.FLASH_MODE_TORCH);
mWakeLock.acquire();
}
};
// Get the notification-service
this.mNM = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
// Display a notification about us starting. We put an icon in the status bar.
showNotification();
// Open camera
this.frontCam = Camera.open();
this.frontCamPara = frontCam.getParameters();
this.frontCam.lock();
// Schedule the …Run Code Online (Sandbox Code Playgroud)