onDraw not getting called for a custom view derived from view in layout
<p>I have a custom view
.........</p>

<pre><code>package com.yasir.canvasTest;


import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.util.Log;
import android.view.View;


public class GraphView extends View {

    private static final String TAG = "GraphView";
    public static boolean BAR = true;
    public static boolean LINE = false;

    private Paint paint;
    private float[] values;
    private String[] horlabels;
    private String[] verlabels;
    private String title;
    private boolean type;
    public Canvas tmpCanvas = null;

    public GraphView(Context context, float[] values, String title, String[] horlabels, String[] verlabels) {
        super(context);
        //setScrollContainer(true);
        Log.v(TAG,"On GraphView==&gt;");




        paint = new Paint();

        setWillNotDraw(false);
        requestLayout();
        invalidate();
    }

    @Override
    protected void onDraw(Canvas canvas) {




        Log.v(TAG,"&lt;==On Draw");

/// drawing code here
        invalidate();
    }

    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        Log.v(TAG,"On onMeasure==&gt;");
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);

        int parentWidth = MeasureSpec.getSize(widthMeasureSpec);
        int parentHeight = MeasureSpec.getSize(heightMeasureSpec);
        setMeasuredDimension(
                parentWidth * 2, parentHeight);
    }

}
</code></pre>

<p>...............
Activity: onCreate
...............</p>

<pre><code>setContentView(R.layout.horscroll);

HorizontalScrollView hsView = (HorizontalScrollView) findViewById(R.id.hzsv);

LinearLayout ll = (LinearLayout) findViewById(R.id.linearParent);
ll.removeAllViews();


// create custom view and add to laywout
GraphView graphView = new GraphView(this, values, "GraphViewDemo",horlabels, verlabels, GraphView.LINE);


hsView.requestLayout();
hsView.setWillNotDraw(false);

ll.requestLayout();
ll.setWillNotDraw(false);
ll.addView(graphView);
</code></pre>

<p>.....................
Xml
....................</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;HorizontalScrollView
 android:id="@+id/hzsv"
 android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;LinearLayout android:id="@+id/linearParent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"&gt;&lt;/LinearLayout&gt;
 &lt;/HorizontalScrollView&gt;
</code></pre>

<p>..................</p>

<p>Regards,
Yasir Perwez</p>
