Tôi có hai phương pháp onclick trong dự án androidAndroid onClick phương pháp
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;
}
});
Và tôi có onther phương pháp onClick trong đó tôi phải gọi đó là phương pháp trực tiếp
prs=(Button)findViewById(R.id.Button02);
prs.setOnClickListener(new OnClickListener() {
----- I have to call that method---
}
});
Có giải pháp nào cho việc này?
Tôi đề nghị bạn làm theo gợi ý 'benvd', nhưng vẫn vì lợi ích của nó, sử dụng' clr.performClick() 'trong Trình nghe. – st0le