UF (Use Freed) issues are reported when there is an attempt to use resources after they were released. The ANDROID.UF.CAMERA warning indicates an attempt to use Camera after it was released.

Example 1

     private Camera camera;
     private void initCamera() {
         camera =;
     public boolean onKeyDown(final int keyCode, final KeyEvent event) {
         if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
             if (camera != null) {
                 final CameraPictureCallbackImpl callback = new CameraPictureCallbackImpl();
                 camera.takePicture(null, null, callback);
             return true;
         return super.onKeyDown(keyCode, event);
     private class CameraPictureCallbackImpl implements Camera.PictureCallback {
         private Bitmap bitmap;
         public void onPictureTaken(final byte[] bytes, final Camera camera) {
             bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
             if (bitmap == null) {
         public Bitmap getBitmap() {
             return bitmap;

ANDROID.UF.CAMERA is reported for the snippet on line 46 since callback method 'onPictureTaken(...)' starts the camera preview even if the camera was released on line 43.


This checker can be extended through the Klocwork knowledge base. See Tuning Java analysis for more information.