启动相机意向的画廊图标 [英] Initiate Camera Intent with the Gallery Icon

查看:193
本文介绍了启动相机意向的画廊图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作访问的摄像头,并返回一个URI,我传递给另一个活动,并显示在ImageView的提取位的应用程序。一切似乎很好地工作。下面是我用它来启动相机意图code。

I am working on an app that accesses the camera and returns an uri, which I pass to another activity and display the extracted bitmap in an ImageView. Everything seems to work fine. Here is the code that I use to initiate the camera intent.

mCameraButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mCameraUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new ContentValues());
            Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
            cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, mCameraUri);
            mtimeCameraAcessed = System.currentTimeMillis();
            startActivityForResult(cameraIntent, RECEIVE_CAMERA_PICTURE);
            overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);

        }

});

不过,我已经注意到的差异。当我的应用程序访问的摄像头,在屏幕底部的图标画廊似乎缺少(当您在任何Android手机上访问相机应用程序图标出现)。我附上了几个截图来说明这一点。

But, I have noticed a discrepancy. When my application access the camera, the gallery icon at the bottom of the screen seems to be missing (the icon appears when you access the camera application on any android phone). I have attached a couple of screenshots to illustrate this.

我希望用户同时能够改变他/她的想法,然后访问同一屏幕上的画廊(通过点击图标图库)访问摄像机。现在,我不知道如何通过Intent.ACTION_PICK启动画廊意图。我也看了看这个问题,但我不完全同意,我需要一个定制摄像机布局要达到什么我打算做:<一href=\"http://stackoverflow.com/questions/2708128/single-intent-to-let-user-take-picture-or-pick-image-from-gallery-in-android\">Single意图让用户拍摄照片或选择从Android图库图片

I want the user to access the camera while being able to change his/her mind and then access the gallery on the same screen (by tapping the gallery icon). Now, I do know how to initiate a gallery intent via 'Intent.ACTION_PICK'. I have also looked at the this question, but I don't completely agree that I need a custom camera layout to achieve what I intend to do: Single intent to let user take picture OR pick image from gallery in Android

我说这个的原因是,我见过的应用程序,如下载快,随着底部的画廊图标访问摄像机的应用程序。任何人都可以请扔一些光对此有何看法?

The reason I say this is because, I have seen apps such as QuickPic that access the camera application with the gallery icon at the bottom. Can anyone please throw some light on this?

推荐答案

通过一些深入的研究去之后,我得出一个结论,这是不可能的逸岸。但是,如果这样的事情需要自定义布局与相机结合的API将是理想的解决方案。但后来,我观察到,在使用相机API有一定的问题,如相机屏幕的倾斜外观。

After going through some thorough research, I have come to a conclusion that this is infact impossible. However, a custom layout combined with the camera api would be the ideal solution if something like this is desired. But then, I have observed that using the camera api has certain problems such as skewed appearance of the camera screen.

下载快将用户在相机屏幕(与画廊的图标),但投下他/她出​​的应用程序,而这样做。在这一点上,用户基本上是在Android上使用股票相机应用,而不是下载快应用程序本身。

QuickPic takes the user to the camera screen (with the gallery icon) but drops him/her out of the app while doing so. At that point, the user is basically using the stock camera app on Android and not the Quickpic app itself.

这篇关于启动相机意向的画廊图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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