6

I'm using a low cost tablet with Android 4.0.3. Here the log:

06-11 23:36:04.653: D/SynopticElement(1583): Size changed to 200x200
06-11 23:36:04.693: D/dalvikvm(1583): GC_FOR_ALLOC freed 62K, 12% free 7275K/8199K, paused 33ms
06-11 23:36:04.713: D/SynopticElement(1583): Size changed to 190x190
06-11 23:36:04.733: D/dalvikvm(1583): GC_FOR_ALLOC freed 9K, 12% free 7583K/8583K, paused 22ms
06-11 23:36:04.743: A/libc(1583): Fatal signal 11 (SIGSEGV) at 0xc52c9d4c (code=1)

Debugging my code:

canvas.scale(getWidth(), getWidth()); //I'm drawing a custom component

Paint frameBackgroundPainter = new Paint();
frameBackgroundPainter.setAntiAlias(true);
frameBackgroundPainter.setStyle(Paint.Style.FILL);
frameBackgroundPainter.setColor(0xff000000);

Paint frameBorderPainter = new Paint();
frameBorderPainter.setAntiAlias(true);
frameBorderPainter.setStrokeWidth(0.007f); //canvas is scaled
frameBorderPainter.setStyle(Paint.Style.STROKE);
frameBorderPainter.setColor(0xffaaaaaa);

RectF frameRect = getFrameBorder(); //simply get the Rect to draw on canvas
canvas.drawRect(frameRect, frameBackgroundPainter); //draw the background 

// ---> If I comment this line app does not crash!!!!! <---
canvas.drawRect(frameRect, frameBorderPainter); //draw the border

There's a problem with the paint stroke width, I tryed with different values:

0.007f -> crash
0.009f -> crash
0.5f -> ok 
0.1f -> ok

Someone may tell me to work with a different canvas scale because of the very low value for the line width: ok, but everything is ok if I set width=0.007f and run the app on Android 2.3 (tablet and phone) and Android 3.0 (tablet)...

I'm not excpetcing any solution to draw border in a different way, I'm wondering if anyone knows if this is a bug of Android 4.0.3.

I'm also thinking it may be a graphic hardware issue of my low cost tablet, unfortunatelly I've no other Android 4.0.3 device to make tests...

My tab metrics:

DisplayMetrics{density=1.0, width=480, height=752, scaledDensity=1.0, xdpi=160.0, ydpi=160.42105}

and for more information about the device visit this link.

Seraphim's
  • 12,559
  • 20
  • 88
  • 129
  • You ran out of memory due to memory leak – XepterX Jun 12 '12 at 10:24
  • 1
    because i had the same status as that on my android 4.0.3 phone and after some research, found this was caused by memory leak – XepterX Jun 12 '12 at 11:36
  • Thanks for your response! So you confirm it's a problem related to the specific version of Android. Any solution? – Seraphim's Jun 12 '12 at 11:50
  • 1
    i didn't had any of that problem with the other versions of android except on the 4.0.3 when i tested on my phone, but this was only confined to my phone. Other 4.0.3 phones used doesn't seem to have this problem. Therefore i can't conclude it's a specific version of android that causes this problem. I have tried things such as calling for flagging for garbage collection but this won't necessarily work. – XepterX Jun 12 '12 at 11:57
  • i do have a question. how many cores is your android 4.0.3 running on? – XepterX Jun 12 '12 at 12:06
  • Visit http://www.epad.hk/Specs.asp?M=ZX07c for more info about the hardware. Ask me for anything else. – Seraphim's Jun 12 '12 at 12:17
  • 1
    Thanks, thought it was cause of the amount of cores in the android phone and ICS. guess it's not. hope you find a way to solve your problem after this. – XepterX Jun 12 '12 at 12:26
  • Yeah, I've no problem to find another way to draw the rect border... but it's so strange! Thanks! – Seraphim's Jun 12 '12 at 12:38
  • I am encountering the same problem in my Toshiba AT300. When I click the notification it doesn't work. I need to resume a media player – iamkristher Oct 07 '13 at 16:33
  • which version of Android? – Seraphim's Oct 08 '13 at 07:12

1 Answers1

0

This was a common error when stopping an OpenGL-ES app on Intel x86 AVD (every launch crashes at onStop()). Here's a quick solution: - Open AndroidManifest.xml, add android:allowClearUserData="true" tag to the application node.

    <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme"
            android:allowClearUserData="true" >

Hoshouns
  • 2,420
  • 23
  • 24