Note that there are some explanatory texts on larger screens.

plurals
  1. POGet image id from Bitmap
    text
    copied!<p>Is there any way to get the image id from the following <code>ActivityResult</code> method?</p> <pre><code>@Override protected void onActivityResult(int requestCode, int resultCode, Intent data){ if(requestCode == IMAGE_CAPTURE){ if(resultCode == RESULT_OK){ try{ Bitmap b1 = MediaStore.Images.Media.getBitmap(getContentResolver(),imageUri); System.out.println("GGEGEGGEGEGEGGEGEGEGEG" + imageUri.getPath()); // Intent i2 = new Intent(Intent.ACTION_VIEW, imageUri); // startActivity(i2); } catch(FileNotFoundException e ){ System.out.println("OnActivityResult hat einen Fehler geworfen"); } catch (IOException e) { System.out.println("ONACTIVITYRESULT hat einen Fehler geworfen"); } } } } </code></pre> <p>I need it to get the thumbnail to a certain image. </p> <p>EDIT: I capture the image like this:</p> <pre><code>private void takePic() { ContentValues values = new ContentValues(); String TITLE = null; values.put(MediaColumns.TITLE, TITLE); String DESCRIPTION = null; long id = (Long) null; values.put(ImageColumns.DESCRIPTION, DESCRIPTION); values.put(MediaColumns.MIME_TYPE, "image/jpeg"); values.put(MediaColumns._ID, id); imageUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); System.out.println("VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVvv" + imageUri.getPath()); startActivityForResult(intent, IMAGE_CAPTURE); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload