1

Here's the code I'm using to open an image taken with the camera with the default gallery:

Dim i As Intent
i.Initialize(i.ACTION_VIEW, "mnt/sdcard/DCIM/Camera/IMG_20121027_205219.jpg")
Log("mnt/sdcard/DCIM/Camera/IMG_20121027_205219.jpg")
i.SetType("image/*")
StartActivity(i)
Log("error:"&I)

When I click the button, the gallery opens and then just force closes itself.

grant1842
  • 357
  • 1
  • 7
  • 23

1 Answers1

2
Dim i As Intent 
i.Initialize(i.ACTION_VIEW, "file:///sdcard/DCIM/Camera/IMG_20121027_205219.jpg")
Log("mnt/sdcard/DCIM/Camera/IMG_20121027_205219.jpg")
i.SetType("image/*")
StartActivity(i)
Log("error:"&I)
Heather McVay
  • 939
  • 3
  • 15
  • 31
  • When answering questions, it's generally a good idea to have an explanation that goes along with the code. Or, in this case, what you changed and why that is necessary. – sachleen Oct 28 '12 at 03:13
  • Now this does bring up the Gallery to view the picture with but it only has the Set As and Share options, not the Delete. Is this a permissions thing that I need to adjust? – grant1842 Oct 28 '12 at 04:52
  • I have set in the manifest editor, so that shouldn't be the issue. – grant1842 Oct 28 '12 at 05:02
  • This is not a permissions thing. This has to do with the functionality of your device or emulator you are testing on. I would suggest to test on multiple devices or emulators. try BlueStacks emulator – Heather McVay Oct 28 '12 at 14:09
  • When I open the same image using the Astro file manager it asks to open the image using the same gallery app and it gives me the Set As and Share and delete options. When I do it using that code, and choose the same gallery, it lacks the delete option. – grant1842 Oct 28 '12 at 18:00
  • you are asking multiple questions from the original question – Heather McVay Oct 29 '12 at 14:49
  • the way stack over flow works is you ask one question, then get an answer and "accept that answer", this helps people in the future know what works. asking multiple questions will confuse them, and also isn't fair if two people answer your two separate questions since you can only accept one answer – Heather McVay Oct 29 '12 at 14:54