android - Get image id from Bitmap -


is there way image id following activityresult method?

@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");                 }             }         }     } 

i need thumbnail image.

edit: capture image this:

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);       } 

once have created imageuri, can id this:

    string[] columns = {mediacolumns._id};      cursor cursor =  getcontentresolver().query(imageuri, columns, null, null, null);      cursor.movetofirst();      long id = cursor.getlong(0); 

note: should remove line code in takepic() because row id created content provider:

    values.put(mediacolumns._id, id); 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -