0

I am trying to programatically launch or open the photo gallery after passing a photo name search parameter. I am new at this. I am thinking maybe intents can be used but not sure so I am wondering if anyone could please point me in the right direction. Preferably with some code examples.

Much thanks.

RE-EDIT

As requested, this is the code I have so far..

Intent intent = new Intent();
                        intent.setType("image/*");
                        intent.setAction(Intent.ACTION_GET_CONTENT);
                        // CAMERA_PIC_REQUEST = 2600;

                        cameraIntent = Intent.createChooser(intent,"Select Picture");
user788511
  • 1,726
  • 2
  • 30
  • 52
  • anyone have an idea, really need some help!! – user788511 Dec 29 '11 at 09:18
  • Post some of the code you have written, then the community might be able to provide a more specific solution for you. – hwrdprkns Dec 29 '11 at 09:23
  • Take a look at this question: http://stackoverflow.com/questions/2169649/open-an-image-in-androids-built-in-gallery-app-programmatically – hwrdprkns Dec 29 '11 at 09:49
  • hwrdprkins, I have but in my case I just want to provide a file name of string value not uri to actually locate. Can this be done? – user788511 Dec 29 '11 at 10:09

2 Answers2

0

you can try follow code:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(photoUri);
context.startActivity(intent);
idiottiger
  • 5,147
  • 2
  • 25
  • 21
0

I think this is what you mean, correct me if I'm wrong:

String nameOfPhotoToBeRetrieved = "myPhoto";
String WHERE = "TITLE ="+nameOfPhotoToBeRetrieved;

Then you can use the following line to deliver a result to your cursor/listener:

CursorLoader(context,content_uri,null,WHERE,null,null).deliverResult(myCursor);

Community
  • 1
  • 1
hwrdprkns
  • 7,525
  • 12
  • 48
  • 69
  • Yes, yes, this is exactly it..could you please provide me a sample code structure for reference? Much much thanks!! – user788511 Dec 29 '11 at 10:42