getting null pointer exception in this code
<pre><code>  public class StartDraw extends Activity  {




@Override

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
   // setContentView(R.layout.main);
    MyView view1 =new MyView(this);
   // view1.setBackgroundResource(R.drawable.ic_launcher);
    setContentView(view1);



}


 public class MyView extends View implements OnTouchListener{
    RelativeLayout.LayoutParams LP;  
    ViewGroup dlayout; 
      ImageView[] ActionI = new ImageView[4];
      ImageView[] ReciverI = new ImageView[4];
    public MyView(Context c) {
        super(c);
     //  dlayout = new ViewGroup(c); // if i use this then error shown {Cannot instantiate the type ViewGroup}
         LP = new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT);
       //  ViewGroup dlayout = (ViewGroup)findViewById(R.id.dlayout);
         dlayout.setLayoutParams(LP); // at this position gettting null pointer exception

}

   @Override
    protected void onDraw(Canvas canvas) {
           paint.setStyle(Paint.Style.STROKE);
           paint.setStrokeWidth(2);
           paint.setColor(Color.GREEN);
           canvas.drawColor(Color.BLUE);

           canvas.drawLine(offset_x, offset_y, currentX, currentY, paint);

    }
}
</code></pre>
