私は 3 秒ごとに自動的にフォーカスし、私のコードはハードウェア デバイス (Galaxy S) で動作しますが、私の AVD (仮想デバイス) では、フォーカスが終了した後に呼び出されるコールバックが呼び出されません。誰かが理由を知っていますか?
public void onPreviewStart(){
Log.v(TAG,"onPreviewStart() focusTimer: "+focusTimer);
if(this.autoFocus == true && getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_AUTOFOCUS)){
focusTimer = new Runnable() {
public void run() {
Log.d(TAG, "focus run..");
if(preview != null && preview.camera != null && !saving){
focusing = true;
Log.d(TAG, "focusing.."+preview);
// ----> this gets called each 3 seconds
preview.camera.autoFocus(new Camera.AutoFocusCallback() {
public void onAutoFocus(boolean success, Camera camera) {
// ----> this never gets called on ICS :(
Log.d(TAG, "onAutoFocus()");
focusing = false;
if(shootButtonWasPressed){ // if shooting was scheduled
Log.d(TAG, "shootButtonWasPressed");
shoot();
shootButtonWasPressed = false;
}
}
});
}
preview.postDelayed(focusTimer, 3000);
}
};
Log.v(TAG,"focusTimer run()");
focusTimer.run();
}else{
focusTimer = null;
}
}