직접 Button 클래스를 상속해서 버튼을 화면에 뿌려주는 것까지는 했습니다.

그런데 그 Button 클래스내에서 click event를 설정했을 때 click 이벤트는 발생하나 R 클래스를 사용하여  TextView를 가져오게 되면 그 TextView 클래스가 null 이네요

public void onClick(View v) {
                String abc=getResources().getString(R.string.app_name);
                TextView tv = (TextView)findViewById(R.id.testTextView1);               
                tv.setText("11");
}
 즉 위의 소스에서 tv 가 null 이네요. 혹시 해결 방법을 아시는 분은 알려주세요

완전 한 소스는 아래와 같습니다.


public class AndirodTest extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ButtonTest bu1 = (ButtonTest)findViewById(R.id.Button00);  
       
        bu1.setClickEvent();       
        }
}


public class ButtonTest extends Button {   
    public ButtonTest(Context context) {
        super(context);
        // TODO Auto-generated constructor stub
    }
   
    public ButtonTest(Context context, AttributeSet attrs) {
        super(context, attrs);
        // TODO Auto-generated constructor stub
    }
   
    public ButtonTest(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        // TODO Auto-generated constructor stub
    }
    public void setClickEvent(){
       
        this.setOnClickListener(new View.OnClickListener() {
           
            @Override
            public void onClick(View v) {
                String abc=getResources().getString(R.string.app_name);
                TextView tv = (TextView)findViewById(R.id.testTextView1);               
                tv.setText("11");
            }
        });
    }
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TextView 
    android:id="@+id/testTextView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello"
    />
   
    <com.test.ButtonTest
        android:id="@+id/Button00"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="ButtonTest0">
    </com.test.ButtonTest>    
   
    <Button
        android:id="@+id/Button01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello">
    </Button>
   
</LinearLayout>