public void onClick2(View view) {
TextView editText = (TextView) findViewById(R.id.textView2);
Object irService = getSystemService("irda");
irService.getClass();
Class irClass = irService.getClass();
Class params[] = new Class[1];
params[0] = String.class;
try {
Method sendIR = irClass.getMethod("write_irsend", params);
for(int i=0;i<2;i++)
sendIR.invoke(irService, "37300,11,67,10,28,10,28,10,27,11,27,11,27,11,67,11,67,11,27,11,68,10,27,11,27,11,27,11,67,11,27,11,1731,11,68,10,28,10,27,11,27,11,27,11,67,11,27,11,27,11,67,11,27,11,67,11,67,11,68,10,27,11,68,10,1653");
editText.setText("Done");
} catch (Exception e) {
e.printStackTrace();
editText.setText("Fail");
}
}