Android的棒棒糖相机问题 [英] Android Lollipop camera issue

查看:164
本文介绍了Android的棒棒糖相机问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Andr​​oid应用程序于所有的Andr​​oid设备工作正常,从2.3版本到4.4。然而,当我更新了我的三星Galaxy S4,以棒棒糖和测试应用程序说,也有功能,如摄像头的几个误区,地图等。

My android application was working fine on all android devices from version 2.3 to 4.4. However, when i updated my Samsung Galaxy S4 to LOLLIPOP and tested the said app, there are a few errors in functionalities such as camera,map etc.

下面是我的应用程序使用本机摄像头使用的code片断:

Below is the code snippet used in my application to utilize the native camera:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   super.onActivityResult( requestCode,  resultCode,  data);
   if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK && null != data) 
   {    
      Bitmap camImg = (Bitmap) data.getExtras().get("data");
   }
}

在这里,我得到(位图)data.getExtras()。获得(数据)作为空。是否有此code任何替代方案。任何帮助将是AP preciated。

Here I am getting (Bitmap) data.getExtras().get("data") as null. Is there any alternate solution for this code. Any help would be appreciated.

推荐答案

我有CommonsWare不同意这一点。我使用android.hardware.Camera与我的应用程序,并用三星Galaxy S4运行棒棒糖测试。看来问题是,是的onCreate之前的onActivityResult上运行的三星棒棒糖应用程序时调用。

I would have to disagree with CommonsWare on this one. I am using the android.hardware.Camera with my app and testing with a Samsung Galaxy S4 running Lollipop. It seems the problem is that onCreate is called before onActivityResult when running the app on Samsung Lollipop.

我的建议是在你的应用设置最大目标20(Android 4.4系统),直到三星排序了这一点。这是三星的问题。

My suggestion is to set the max target in your app to 20 (Android 4.4) until Samsung sorts this out. It is a Samsung issue.

 android:maxSdkVersion="20"

这篇关于Android的棒棒糖相机问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆