Canvas not visible on particular device (One X)
<p>I think I am facing a small issue. My problem is that I am drawing a speedometer based on  <a href="http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/" rel="nofollow">http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/</a>. And the needle is visible on all devices that I have but not on HTC One X. On checking, I found that the canvas density (canvas.getDensity()) is returned as 0. Could that be the reason it is not visible? Also tested on S3 which has the same OS (4.0.4). Works fine there.</p>

<pre><code>    handPath = new Path();
    handPath.moveTo(0.5f, 0.5f + 0.0f);
    handPath.lineTo(0.5f - 0.010f, 0.5f + 0.0f - 0.00f);
    handPath.lineTo(0.5f - 0.002f, 0.5f - 0.22f);
    handPath.lineTo(0.5f + 0.002f, 0.5f - 0.22f);
    handPath.lineTo(0.5f + 0.010f, 0.5f + 0.0f - 0.00f);
    handPath.lineTo(0.5f, 0.5f + 0.0f);
    handPath.addCircle(0.5f, 0.5f, 0.05f, Path.Direction.CW);


    private void drawHand(Canvas canvas) {
    // if (handInitialized) {
    float handAngle = degreeToAngle(handPosition);
    // float handAngle = 0;
    canvas.save(Canvas.MATRIX_SAVE_FLAG);
    canvas.rotate(handAngle, 0.5f, 0.5f);
    canvas.drawPath(handPath, handPaint);
    canvas.restore();
    float scale = getScaled(canvas,canvas.getWidth());
    canvas.scale(scale, scale);
    canvas.drawCircle(0.5f, 0.5f, 0.01f, handScrewPaint);
    // }
}
</code></pre>
