android - get captured image to other activity -


helo,

i have 2 activities , b. in activity have google map , button. button allow me take picture. after taking picture want in activity b can edit , give title , on.

this method in activity wenn click button take picture

private void ontakefoto() {       intent fotointent = new intent(android.provider.mediastore.action_image_capture);      startactivityforresult(fotointent, camera_result);  }  @override protected void onactivityresult(int requestcode, int resultcode, intent data) {      super.onactivityresult(requestcode, resultcode, data);      if (resultcode == result_ok && requestcode == camera_result) {          intent intentb = new intent(this, b.class);         startactivityforresult(intentb , camera_result);      }  } 

in activity b have imageview , edittext. want show captured image in imageview in activty b. how can it? can give me tip that?

thanks

in onactivityresult have code:

string res = null;         string[] proj = {mediastore.images.media.data};         cursor cursor =  getcontentresolver().query(mediastore.images.media.external_content_uri, proj, null, null, null);         if (cursor.movetolast()) {             int column_index = cursor.getcolumnindexorthrow(mediastore.images.media.data);             res =  cursor.getstring(column_index);                             cursor.close();                 bitmap bitmap = bitmapfactory.decodefile(res);                 m_currentimage.setimagebitmap(bitmap);          } 

as said got other image , not captured one. can sombody tell me mistake?

you can start camera in activity b class , take picture , set picture on imageview.use way...

@override     protected void onactivityresult(int requestcode, int resultcode,             intent resultdata) {         super.onactivityresult(requestcode, resultcode, resultdata);            try {              if ( resultdata != null) {                  string[] projection = { mediastore.images.media.data };                 cursor cursor = managedquery(                         mediastore.images.media.external_content_uri,                         projection, null, null, null);                 int column_index_data = cursor                         .getcolumnindexorthrow(mediastore.images.media.data);                 cursor.movetolast();                  uploadimagepath = cursor.getstring(column_index_data);                 bitmapuploadimage = bitmapfactory.decodefile(uploadimagepath);                 profileimageview.setimagebitmap(bitmapuploadimage); 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -