// Rel1 btn click mRel1Btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mRel1Btn.setClickable(false); if (mBlueAdapter.isEnabled()) { try { OutputStream mOutputStream = mBtSocket.getOutputStream(); mOutputStream.write(RELAY1_JDY30_ON); //showToast("Relais 1 an"); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } mOutputStream.write(RELAY1_JDY30_OFF); //showToast("Relais 1 aus"); } catch (IOException e) { e.printStackTrace(); } } mRel1Btn.setClickable(true); }