Hi, data size is 960987 bytes, logcat:
V/ImageCaptureCallback( 8863): onpicturetaken...@43678fb0 length = 960987 I'll try to increase heap size next, thx. olli On Aug 15, 8:24 am, powerbyte <[email protected]> wrote: > Hello Olli, > > what is the size of byte[]data? > may be problem with the heap size. In logcat output, is something like > grow heap? if yes, try with increasing heap size. > > pb > > On Aug 14, 2:22 pm, Elias <[email protected]> wrote: > > > I have tried to share betweeb two simpleactivities: > > > On "parent" activity, I'll start ImageCapture Activity: > > > IntentcameraIntent = newIntent(); > > cameraIntent.setClass(this, ImageCapture.class); > > cameraIntent.putExtra("cameraData", "null"); //not sure > > why > > this is here? > > startActivityForResult(cameraIntent, 1); > > > @Override > > protected void onActivityResult(int requestCode, int resultCode, > >Intentdata) { > > CharSequence text = "onActivityResult requestCode " + > > requestCode + " resultCode " + resultCode + "data" +data; > > int duration = Toast.LENGTH_LONG; > > Toast toast = Toast.makeText(this, text, duration); > > toast.show(); > > } > > > And on camera Activity (I have inner class which implements > > PictureCallback): > > > �...@override > > public void onPictureTaken(byte[]data, Camera camera) { > > try { > > IntentresultIntent = newIntent(); > > resultIntent.putExtra("cameraData",data); > > setResult(Activity.RESULT_OK,resultIntent); > > finish(); > > } catch (Exception ex) { > > setResult(Activity.RESULT_CANCELED); > > finish(); > > } > > } > > > It seems that onActivityResult method is never called, what am I > > missing here? Camera activity is closed and first activity is shown > > again but onActivityResult is not called. > > It works perfectly fine (onActivityResult is called and toast is > > displayed) if do following on cameraintent: > > > @Override > > public void onPictureTaken(byte[]data, Camera camera) { > > try { > > //IntentresultIntent = newIntent(); > > //resultIntent.putExtra("cameraData",data); > > setResult(Activity.RESULT_OK); > > finish(); > > } catch (Exception ex) { > > setResult(Activity.RESULT_CANCELED); > > finish(); > > } > > > With code above Activity.RESULT_OK (-1) is returned to > > onActivityResult method. > > I'm testing with HTC Hero. > > > Cheers > > Olli > > > On 7 elo, 17:48, elpix1 <[email protected]> wrote: > > > > Another way to sharedatabetweenactivitiesin the same process > > > is to use the Application class: > > > >http://developer.android.com/reference/android/app/Application.html > > > > You have to specify the name of your Application class in the > > > manifest and the framework will create only an instance of this > > > class, which will live while the application process is running. > > > > In any activity, you can get the reference for your application > > > instance using: > > > > Application a = getApplication(); > > > > On Jul 22, 10:49 am, Per Sandström <[email protected]> wrote: > > > > > So far I have been using SharedPreferences to sharedatabetween > > > >activities. But I would very much like to find a better way. I would > > > > simply like both Activity1 and Activity2 to share Object1. Activity1 > > > > will create Object1 and then start Activity2. What is the smartest way > > > > to give Activity2 a pointer to Object1? > > > > > To summarize:Activitiesdon't have constructors! How do I senddata > > > > to them from their parent activity??? > > > > > Regards, > > > > Per Sandström- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

