简体   繁体   English

在android中拍照时出现问题,请关闭我的应用程序“(…)ResultInfo {who = null,request = 1,result = 0,data = null}到活动……”

[英]Problems taking picture in android, close my application “(…) ResultInfo {who = null, request = 1, result = 0, data = null} to activity …”

Good friends, A few days I've been trying to solve this problem, I see that there are several in the forum, but none have managed to solve my problem. 好的朋友,几天来我一直在尝试解决这个问题,我发现论坛中有很多人,但是没有人能够解决我的问题。

I have an ImageView and a Button to take the picture. 我有一个ImageView和一个按钮来拍照。 In the event of the button I have this code: 在按钮的情况下,我有以下代码:

 oButton.setOnClickListener(new OnClickListener() {             
                    public void onClick(View v) {
                        //oImageActual is the final ImageView
                        oImageActual = oView;
                        Intent intent =  new Intent(MediaStore.ACTION_IMAGE_CAPTURE);                           
                        startActivityForResult(intent, TAKE_PICTURE);
                    }                       
                });

and the result of the activity, I have this one: 和活动的结果,我得到了这一点:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == TAKE_PICTURE && (resultCode == Activity.RESULT_OK)) {            
        if (data != null) {
            if (data.hasExtra("data")) {                    
                 Bitmap photo = (Bitmap) data.getExtras().get("data"); 
                 oImageActual.setImageBitmap(photo);                    
            }
        }
    }
}

The problem is that several times it works, and fails several times, I mean, funcina, take the photo and puts it in ImageView, but many times you close the application. 问题是,它多次运行,失败几次,我是说funcina,拍摄照片并将其放在ImageView中,但是很多时候关闭应用程序。 I have to reboot the phone to work again. 我必须重启手机才能再次使用。

This is the main problem we get: 这是我们得到的主要问题:

(...)java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=inline-data (has extras) }} to activity(...) (...)java.lang.RuntimeException:无法将结果ResultInfo {who = null,request = 1,result = -1,data = Intent {act = inline-data(has extras}})传递给活动(... )

If anyone has an answer, please be waiting here, thanks. 如果有人有答案,请在这里等待,谢谢。

"take the photo and puts it in ImageView, but many times you close the application." “拍摄照片并将其放入ImageView,但是很多时候您关闭该应用程序。”

If i am understanding this right, you are closing the activity before the result is returned. 如果我理解此权利,那么您将在返回结果之前关闭活动。 onActivity result only gets the result if the parent activity is not closed during the whole event. 如果整个活动期间未关闭父活动,则onActivity结果只能获取结果。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 android camera:将结果ResultInfo {who = null,request = 0,result = -1,data = null}传递给activity - android camera : Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity 无法将结果ResultInfo {who = null,request = 42,result = 0,data = null}传递给活动 - Failure delivering result ResultInfo{who=null, request=42, result=0, data=null} to activity 传递结果ResultInfo失败(who = null,request = 1,result = 0,data = null) - Failure delivering result ResultInfo(who=null, request=1, result=0, data=null) 无法将结果ResultInfo {who = null,request = 2,result = -1,data = Intent {}}传递给活动 - Failure delivering result ResultInfo{who=null, request=2, result=-1, data=Intent { }} to activity java.lang.RuntimeException:将结果ResultInfo {who = null,request = 1,result = -1,data = intent}传递给活动失败 - java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=intent} to activity 无法传递结果ResultInfo {who = null,request = 0,result = -1,data =活动意图 - Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent to activity java.lang.RuntimeException:无法将结果ResultInfo {who = null,request = 131074,result = -1,data = Intent {(具有其他功能)}}传递给活动 - java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=131074, result=-1, data=Intent { (has extras) }} to activity java.lang.RuntimeException:无法将结果ResultInfo {who = null,request = 1,result = -1,data = Intent {(has extras}}}传递给活动 - java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity 无法传送结果ResultInfo {who = null,request = 2,result = 0,data = null}摄像机 - Failure delivering result ResultInfo{who=null, request=2, result=0, data=null} camera table name = null; NullPointerException传递结果失败ResultInfo {who = null,request = 1,result = -1,data = Intent - table name = null; NullPointerException Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM