被破坏prevent活动 [英] Prevent activity from being destroyed

查看:125
本文介绍了被破坏prevent活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm从我呼吁这样一个活动发送意图相机

I´m sending an intent to the camera from an activity that I call like this:

 Intent testphoto = new Intent(Dashboard.this,CameraHandler.class);
 startActivity(testphoto);

在CameraHandler I类调用摄像头:

In the CameraHandler class I call the camera:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); 
startActivityForResult(intent, 0);

但在此之前 onActivityResult 是所谓的camerahandler类中的活性被破坏。反正是有prevent呢?

But before onActivityResultis called in the camerahandler class the activity is destroyed. Is there anyway to prevent this?

找到了答案: 我在我的androidmanifest nohistory =真实的,所取得的结果之前的OS破坏活动。

FOUND THE ANSWER: I had in my androidmanifest nohistory=true and that made the OS destroy the activity before the result.

推荐答案

要确保你没有不保留活动开发者设置的,因为它会破坏你离开了活动。

Be sure you don't have the "Don't keep activities" Developer setting on, as it will destroy the activity you are leaving.

这篇关于被破坏prevent活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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