![]() Int columnIndex = cursor.getColumnIndex(filePathColumn) Intent chooserIntent = Intent.createChooser(getIntent, "Select Image") ĬhooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent Ĭursor cursor = getContentResolver().query(selectedImage, Intent pickIntent = new Intent(Intent.ACTION_PICK, .Media.EXTERNAL_CONTENT_URI) To allow the user to also use any gallery apps they might have installed: Intent getIntent = new Intent(Intent.ACTION_GET_CONTENT) StartActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE) ĭon't forget also to create the constant PICK_IMAGE, so you can recognize when the user comes back from the image gallery Activity: public static final int PICK_IMAGE = void onActivityResult(int requestCode, int resultCode, Intent data) Your photo is now saved in the Gallery app.Absolutely.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |