相关疑难解决方法(0)

Android 4.0.3上的画布上奇怪的崩溃绘图.A/libc:致命信号11(SIGSEGV)

我正在使用Android 4.0.3的低成本平板电脑.这里的日志:

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)
Run Code Online (Sandbox Code Playgroud)

调试我的代码:

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(); …
Run Code Online (Sandbox Code Playgroud)

crash android paint segmentation-fault android-canvas

6
推荐指数
1
解决办法
4075
查看次数