7

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);
mob_web_dev
  • 2,342
  • 1
  • 20
  • 42
  • did you find a solution? – 3iL Mar 19 '18 at 07:19
  • @3iL No, I didn't – mob_web_dev Mar 19 '18 at 11:18
  • Its not a general solution but you can do this by read all the files _(by default these are in ascending order but you can sort the list of files according to date)_ the camera **DCIM/Camera** check this [https://stackoverflow.com/questions/8646984/how-to-list-files-in-an-android-directory] and show the latest one in the camera activity as icon (**ImageView**) or anything you want. – A. Wahab Oct 29 '18 at 06:42
  • you can try adding a custom camera view, with that you can design your screen as required – Uma Achanta Oct 30 '18 at 05:33
  • follow these read these might help u https://stackoverflow.com/questions/12483617/how-to-add-gallery-button-to-camera-open-with-intent – Moktahid Al Faisal Oct 30 '18 at 21:01

2 Answers2

2

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

Abhishek Patel
  • 587
  • 2
  • 8
  • 25
  • 1
    I was looking for a simpler way than creating a custom camera view, but I guess this is the only way to go... Thanks for your answer. – Asym Nov 03 '18 at 17:00
1

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.

Jawad Malik
  • 608
  • 5
  • 21
  • Hey, thanks for your answer, but it's not showing gallery icon on my device.. I guess there is no other way than making a custom camera view... – Asym Nov 03 '18 at 16:59
  • 1
    you are welcome. See Abisheikh's Answer, Maybe that will help you. – Jawad Malik Nov 04 '18 at 10:54