In the application the user can select an image. To start the gallery I use the following code:
Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, ACTIVITY_SELECT_IMAGE);
When I print the path in onActivityResult method, I get the image path like /external/images/media/5615. I’d like to know the image extension, because the image needs to be uploaded to a server. The extension may vary.
What you’re getting is a path the MediaStore uses to get the Images. The following code will take the result from your Intent, and get the filename attached to it: