lundi 28 décembre 2015

Get Image path and store In SQLite Android

I am trying to get the path of the image the user selects from the gallery. So far I have made the button and used the following code to get the user to select the image from gallery:

public void image(View v) {
    Intent intent = new Intent();
    intent.setType("image/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT_PICTURE);
}

Now, I'm trying to get the path of this image so that I can store it in the database to be used to retrieve it later. I know how to insert the path into the DB but just don't know how to get the path name.

Also, I want to copy the image the user has selected and paste into a new folder, where all the images will be.

Any help will be appreciated.

Thanks

Aucun commentaire:

Enregistrer un commentaire