1
Guys I’m taking a bitmap of a gridview and displaying in another Activity, then when I open 3x the other Activity the app hangs and closes.
First action
view.buildDrawingCache();
Bitmap bitmap = view.getDrawingCache();
Second
Bitmap bitmap = getArguments().getParcelable("SEU_BITMAP");
You can help me with that?
03-16 14:17:50.890: E/AndroidRuntime(11180): FATAL EXCEPTION: main
03-16 14:17:50.890: E/AndroidRuntime(11180): Process: com.ompex.zueriabrasil, PID: 11180
03-16 14:17:50.890: E/AndroidRuntime(11180): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@45039080
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1084)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.GLES20Canvas.drawBitmap(GLES20Canvas.java:844)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:490)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.widget.ImageView.onDraw(ImageView.java:1019)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14613)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13510)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13505)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14616)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.widget.FrameLayout.draw(FrameLayout.java:472)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.widget.ScrollView.draw(ScrollView.java:1603)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13510)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13505)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13505)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13505)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14616)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13510)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.dispatchDraw(CustomViewAbove.java:827)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14616)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13510)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13505)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13505)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14616)
03-16 14:17:50.890: E/AndroidRuntime(11180): at com.android.internal.widget.ActionBarOverlayLayout.draw(ActionBarOverlayLayout.java:381)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13510)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.getDisplayList(View.java:13552)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14330)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.view.View.draw(View.java:14616)
03-16 14:17:50.890: E/AndroidRuntime(11180): at android.widget.FrameLayout.draw(FrameLayout.java:472)
03-16 14:17:50.890: E/AndroidRuntime(11180): at com.android.internal.p
Let me guess,
OutOfMemory
? More details of the error that is occurring. Post the output in the stack trace.– Fernando Leal
I’ve already asked the question
– Alisson Hirle