Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show gallery icon in Camera View?

IMAGE Aenter image description here

IMAGE Benter image description here

The First image is the screenshot of default camera view and the second image is the screenshot of camera view open by intent on my app.

The problem is the default camera have gallery icon.How i can show the gallery icon when i open the camera from my app ?

I used this code for open camera

Intent takeImageIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
like image 856
mob_web_dev Avatar asked Aug 29 '16 10:08

mob_web_dev


People also ask

What is the code to open phone gallery?

What is the code to open phone gallery? To open gallery: (This should be in your activity class.) public OnClickListener btnChoosePhotoPressed = new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Intent. ACTION_PICK, android.

How can select image from gallery and camera in Android programmatically?

Run the application on an Android phone. Selecting "Take photo" will open your camera. Finally, the image clicked will be displayed in the ImageView. Selecting "Choose from Gallery" will open your gallery (note that the image captured earlier has been added to the phone gallery).

How do I open camera on Android?

Tap the app drawer icon. It's the icon made of 6 to 9 small dots or squares at the bottom of the home screen. This opens the list of apps on your Android. If you see the Camera app on the home screen, you don't have to open the app drawer. Just tap Camera or the icon that looks like a camera.


2 Answers

The on the stock camera intent cant really be changed, but if you create a custom camera intent, you can add the buttons that you need and link it to another activity that will open a gallery.

There is a very detailed explanation on how to set it up in the android documentation

https://developer.android.com/training/camera/cameradirect

like image 186
Abhishek Patel Avatar answered Oct 03 '22 02:10

Abhishek Patel


use this piece of code.

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);

working fine for me and Gallery icon is also showing.

like image 24
Jawad Malik Avatar answered Oct 03 '22 02:10

Jawad Malik