简体   繁体   English

带有外部相机应用程序的android相机意图,是否返回原始活动?

[英]android camera intent with external camera app, return to original activity?

If a user has an external camera app, such as camera+ that is set as their camera default, how do I make sure that after capturing a photo, it will go back to my original application activity? 如果用户有一个外部相机应用程序,例如将camera +设置为他们的相机默认值,我如何确保在捕获照片后将其返回到我原来的应用程序活动?

       public void onClick(View v) {

            switch (v.getId()){
            case R.id.photo_camera_button:
                Intent photoIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
                startActivityForResult(photoIntent, CAMERA_PHOTO_REQUEST);
            break;
            }
        }

   protected void onActivityResult(int requestCode, int resultCode, Intent data){
        super.onActivityResult(requestCode, resultCode, data);
        if(resultCode == RESULT_OK){
            if(requestCode == CAMERA_PHOTO_REQUEST){
                Bundle extras = data.getExtras();
                Bitmap bmp = (Bitmap) extras.get("data");
                ImageView imv = (ImageView) findViewById(R.id.ReturnedImageView);
                imv.setImageBitmap(bmp);

            }

        }
    }

This application is supposed to capture an image and send it back to an imageview, but after capturing a photo, the camera application is still there. 该应用程序应该捕获图像并将其发送回图像视图,但是捕获照片后,相机应用程序仍然存在。 I would like it to go back, or would I have to set up from scratch a new camera application? 我想返回,还是必须从头开始设置新的相机应用程序?

Although, I would like it to use camera+ features and then when the user saves the image (typically it'll go to my SDcard, I believe) it'll kill the app, and then go back to my activity? 虽然,我希望它使用Camera +功能,然后当用户保存图像时(我相信,通常将其保存到我的SD卡中)会杀死该应用程序,然后返回我的活动? Maybe override something? 也许覆盖一些东西?

Any help? 有什么帮助吗? Thank you! 谢谢!


What your asking is very hard to answer as i dnt know weather your third party app provide the feature of throwing back the result .You question could be answered properly if you have code of that third party app / see the doc weather they offer there app to be used by some third party 您的要求很难回答,因为我不知道您的第三方应用程序提供了返回结果的功能。如果您具有该第三方应用程序的代码/请参阅他们在该应用程序中提供的文档天气,则可以正确回答您的问题由某些第三方使用

And developing new camera app by your self is not a such big task . 而且,自行开发新的相机应用程序并不是一项艰巨的任务。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM