我已經在Android項目的Android的onClick方法
clr=(Button)findViewById(R.id.Button01);
clr.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
tv1.setText("CLR");
et1.setText("");
refrigerant = "";
pres = "";
temperature = "";
superheat_oda = 0;
sub_cool = 0;
}
});
2種的onclick方法,我有onther的onClick方法中,我要直接打電話
prs=(Button)findViewById(R.id.Button02);
prs.setOnClickListener(new OnClickListener() {
----- I have to call that method---
}
});
該方法是否有此任何解決方案?
我建議你遵循'benvd'建議,但仍然爲了它, 在Listener中使用'clr.performClick()'。 – st0le 2010-09-17 09:31:21