作成したボタンに onclicklistener を実装しようとすると、nullpointer 例外が発生し続けます。
Button setHighBtn[] = null;
Button setLowBtn[]=null;
TextView tv[] = new TextView[oNumber];
for (int i=0;i<oNumber;i++){
tv[i] = new TextView(this);
tv[i].setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
tv[i].setText(oName[i]);
tv[i].setTextSize(20);
//tv[i].setLayoutParam)
layout.addView(tv[i]);
if (capability[i]==0){
LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.full_capabilities, layout);
setHighBtn[i]=(Button)findViewById(R.id.setHigh);
setHighBtn[i]=(Button)findViewById(R.id.setLow);
setHighBtn[i].setOnClickListener(this);
setLowBtn[i].setOnClickListener(this);
}else{
setHighBtn[i]=null;
setLowBtn[i]=null;
}
}