Search code examples
javaandroidcanvasdrawtext

Canvas Draw Text is not showing text on real device/emulator


I have used canvas.drawText("1"....), but it shows differently on real device and emulator. Layout Editor shows '1' correctly Here

But on device/emulator it shows like this

I tried disabling hardware acceleration in manifest file but it doesn't work.

I also tried "text" string, same thing happened layout editor / device&emulator


Solution

  • I just find the solution, I was using Paint.Style.STROKE, I changed it to fill with paint.setStyle(Paint.Style.FILL); and it solved my problem