/** * onClick * * <p>extracts the relai that was clicked, and asks the ipx to open then close the corresponding * relai */ @Override public void onClick(View view) { Ipx800Control ipx = context.getIpx(); if (view instanceof Button) { Button button = (Button) view; // Log.d(TAG, "hit the button " + button.getHint()+ "id = "+button.getId()); try { int port2trigger = Integer.parseInt("" + button.getHint()); // Log.d(TAG, "would trigger ipx out "+port2trigger); try { ipx.set(port2trigger, true); ipx.set(port2trigger, false); } catch (Exception e) { Toast.makeText(context, "error:" + e, Toast.LENGTH_LONG).show(); } } catch (NumberFormatException e) { // ok, we hit a special button.... if (button.getId() == R.id.servernameValue) context.callSettings(); else if (button.getHint().equals("fill_me")) context.callSettings(); // else Log.e(TAG,"unknown button code: "+button.getHint()); } } }