Possible Duplicate:
How to pass image data from one activity to another activity?
pass a bitmap image from one activity to another
I tried to get a bitmap from view like below
View s = ml.getRootView();
s.setDrawingCacheEnabled(true);
Bitmap b = s.getDrawingCache();
System.out.println(b.isRecycled());
Log.e("ok","ok");
Intent i=new Intent(CameraActivity.this,Update.class);
i.putExtra("data",b);
startActivity(i);
// s.setDrawingCacheEnabled(false);
s.setVisibility(View.GONE);
finish();
I tried to transfer the bitmap from this Activity to another,but it is showing me black screen and app gets crashed.
s.setVisibility(View.GONE); If I dont give this statement it is showing me this modified Activity and then it is showing Black screen.
I think it is taking much time to transfer this bitmap.
How can I solve this issue?
please help
Thanks
Logcat after getting Black screen
12-06 11:23:34.654: E/AndroidRuntime(16900): FATAL EXCEPTION: main
12-06 11:23:34.654: E/AndroidRuntime(16900): java.lang.NullPointerException
12-06 11:23:34.654: E/AndroidRuntime(16900): at android.app.ActivityThread.handleStopActivity(ActivityThread.java:2595)
12-06 11:23:34.654: E/AndroidRuntime(16900): at android.app.ActivityThread.access$1800(ActivityThread.java:124)
12-06 11:23:34.654: E/AndroidRuntime(16900): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:985)
12-06 11:23:34.654: E/AndroidRuntime(16900): at android.os.Handler.dispatchMessage(Handler.java:99)
12-06 11:23:34.654: E/AndroidRuntime(16900): at android.os.Looper.loop(Looper.java:123)
12-06 11:23:34.654: E/AndroidRuntime(16900): at android.app.ActivityThread.main(ActivityThread.java:3806)
12-06 11:23:34.654: E/AndroidRuntime(16900): at java.lang.reflect.Method.invokeNative(Native Method)
12-06 11:23:34.654: E/AndroidRuntime(16900): at java.lang.reflect.Method.invoke(Method.java:507)
12-06 11:23:34.654: E/AndroidRuntime(16900): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-06 11:23:34.654: E/AndroidRuntime(16900): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-06 11:23:34.654: E/AndroidRuntime(16900): at dalvik.system.NativeStart.main(Native Method)
12-06 11:23:36.490: W/InputManagerService(1318): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40a84730