package com.android.test;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

public class testkk extends Activity implements View.OnClickListener{

 testView test;
 Button button;
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  LinearLayout layout = new LinearLayout(this);
  setContentView(layout);

  test = new testView(this);
  button = new Button(this);

  layout.addView(test, new LinearLayout.LayoutParams(200,200));
  layout.addView(button, new LinearLayout.LayoutParams(200,100));

  button.setOnClickListener(this);

 }

 public class testView extends View
 {
  int value = 10;
  Paint xx = new Paint();


  public testView(Context context)
  {
   super(context);
  }

  public testView(Context context, AttributeSet attrs) {
   super(context, attrs);
   // TODO Auto-generated constructor stub
  }

  public void onDraw(Canvas canvas){

   xx.setColor(Color.RED);
   canvas.drawLine(0,0,value,value,xx);   
  }
 }

 @Override
 public void onClick(View v) {

  while (test.value < 200)
  {
   Log.d("kk"," = "+ test.value);
   test.value += 10;
   test.invalidate();
   
   try {
    Thread.sleep(100);
   } catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
  }
 }
}

invalidate() 함수가 repaint() 와 같은 기능을 한다고 테스트 하고 있는데요.
일단 동작 하고 싶은 것은 0.1 초 마다 대각선으로 line 이 늘어나는 소스 인데요.
(처음과 최종 line 만 표시 되네요)

line 이 실시간으로 늘어나는 상황을 보고 싶은데 잘 안되는데 어디가 잘 못 된건가요?