1

I'm using SL4A to code a tool to upload images from the gallery to my own image service. But I can't figure out how I can get an image from the gallery. I think I need intents for that, but I can't find anything related to that on the internet. (Oh yeah, I'm using Python.)

Any help would be appreciated!

Mezgrman
  • 876
  • 6
  • 11

1 Answers1

0

You would be right; SL4A APIs such as makeIntent(), startActivityForResult() and startActivityForResultIntent() will be of interest to you. It's just a quick Google or two to find the Intent details for fetching images, eg., android pick images from gallery

Personally I tried various alternative of:

intent = droid.makeIntent('ACTION_GET_CONTENT',"",'image/*')
result = droid.startActivityForResultIntent(intent)

But it didn't like me.... I got something along the lines of No activity found ..., which would suggest the need to create an Intent Chooser, which is apparently impossible :/

Apologies that I can't be of much more use.

Good luck!

Community
  • 1
  • 1
Grace B
  • 1,386
  • 11
  • 30
  • I managed to do it now. I had to use the following code: `droid.startActivityForResult('android.intent.action.GET_CONTENT', None, '*/*')` So now I can not only choose from the gallery, but also from almost every other app that lets me choose content, like ES File Explorer etc. :) – Mezgrman Oct 18 '12 at 20:53