I\'m working on a simple Android app for plotting routes on a map. All is going well, but I have an issue when zooming in on my Samsung Galaxy S2. It works fine on a Galaxy S3
You said that code above was an equivalent (not the real code you are running) and that's clear because you are returning a Path
object in a onDraw()
which you couldn't.
The "compressed form" of code you show should work as well as using the drawLine()
. So the problem should come from something else (may the original code).
Anyway, I'll give you a couple of hints:
If for some reason you really want to use the slower approach of drawLine()
, you can use the follwing to make the line look better:
paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeJoin(Paint.Join.ROUND);
paint.setStrokeCap(Paint.Cap.ROUND);
paint.setColor(...);
paint.setAlpha(...);
paint.setStrokeWidth(...);
Finally, if the issue remains, update your question with more relevant code and let me know. Maybe I can help further.
Regards.