title: android custom view redraw
body: <p>I am trying to redraw the custom view in <code>onCreate()</code> method  </p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState)    
  {    
          super.onCreate(savedInstanceState);    
          setContentView(R.layout.main);    
          circleView = (CircleView)findViewById(R.id.circleView);    
          circleView.setCircle(100, 100, 25);    
          circleView.wrapView();    
   }    
  </code></pre>
  
  <p>and custom view is :</p>
  
  <pre><code>public class CircleView extends View  
  {  
      private Paint paint = null;  
      private int x = 50;  
      private int y = 50;  
      private int radius = 50;  
      public CircleView(Context context, AttributeSet attrs)   
      {  
          super(context, attrs);  
          init();  
      }  
      public CircleView(Context context)    
      {  
          super(context);  
          init();  
      }  
      private void init()  
      {  
          paint = new Paint();  
      }   
      public void setCircle(int x, int y, int radius)  
      {  
          this.x = x;  
          this.y = y;  
          this.radius = radius;  
          init();  
          this.invalidate();  
      }  
      @Override  
      protected void onDraw(Canvas canvas)   
      {  
          super.onDraw(canvas);  
          paint.setColor(Color.WHITE);  
          canvas.drawCircle(x, y, radius, paint);  
          Log.e("", "radius : " + radius);  
      }  
          public void setColor(int color)  
      {  
          paint.setColor(color);  
      }  
      public void wrapView()   
      {  
          this.setLayoutParams(new RelativeLayout.LayoutParams(radius*2, radius*2));  
          this.invalidate();  
      }  
  }
  </code></pre>
  
  <p>and xml is:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:id="@+id/layoutMain"
      &gt;
  
      &lt;com.pep1439.view.CircleView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/circleView" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>i just want to resize the circle, but failed. Help me to draw circle with any radius. How to do this. Its working fine if i use default values. It draws the circle when i remove the line <code>circleView.setCircle(100, 100, 25);</code>. I want to adjust circle at run time.
  thanks.</p>