Android 如何在黑莓10设备的安卓移植应用程序中获取摄像头拍摄图像的方向?

Android 如何在黑莓10设备的安卓移植应用程序中获取摄像头拍摄图像的方向?,android,camera,blackberry-10,Android,Camera,Blackberry 10,我已经将android应用程序移植到黑莓10设备上。摄像机捕获的图像使用“ExiFinInterface”来识别图像的方向。但它总是返回0。如何在Blackberry Z10设备中识别方向,同时通过摄像头拍摄图像。我使用了以下代码 try { ExifInterface exif = new ExifInterface(path); orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION,

我已经将android应用程序移植到黑莓10设备上。摄像机捕获的图像使用“ExiFinInterface”来识别图像的方向。但它总是返回0。如何在Blackberry Z10设备中识别方向,同时通过摄像头拍摄图像。我使用了以下代码

try 
  {
       ExifInterface exif = new ExifInterface(path);
       orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
       if(orientation == android.media.ExifInterface.ORIENTATION_ROTATE_90){
        orientation = 90;
       } else if(orientation == android.media.ExifInterface.ORIENTATION_ROTATE_180){
        orientation = 180;
       } else if(orientation == android.media.ExifInterface.ORIENTATION_ROTATE_270){
        orientation = 270;
       }
  } 
  catch (IOException e)
  {
      Log.error(null, e);
      e.printStackTrace();
  }
谢谢你的帮助