I create an application for use flash LED android as torch or as strobe light and add wake lock and power manager for not sleep.But when the user go to menu setup my apk crashed.Without wake lock work fine!How i fix it?
private PowerManager.WakeLock wl;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "Flash Strobe");
// .......................
case R.id.menu_setup:
stopTask();//stop timer repeat blink
if (camera != null) {
camera.release();
}
wl.release();
finish();
startActivity(new Intent(this, Setup.class));
return true;
default:
return super.onOptionsItemSelected(item);
}
LogCat:
W/ServiceManager(148): Permission failure: com.sonyericsson.permission.CAMERA_EXTENDED from uid=10151 pid=24623
f_button_handler button callback not registered