try { camera = Camera.open(); photoButton.setEnabled(true); } catch (Exception e) { Log.e(TAG, "No camera with exception: " + e.getMessage()); photoButton.setEnabled(false); Toast.makeText(getActivity(), "No camera detected", Toast.LENGTH_LONG).show(); try { camera = Camera.open(); photoButton.setEnabled(true); } catch (Exception e) { Log.i(TAG, "No camera: " + e.getMessage()); photoButton.setEnabled(false); Toast.makeText(getActivity(), "No camera detected", Toast.LENGTH_LONG).show();
try { if (event.getPropertyName().equals("enabled")) { setEnabled(getAction().isEnabled());
try { if (event.getPropertyName().equals("enabled")) { setEnabled(getAction().isEnabled());
try { if (event.getPropertyName().equals("enabled")) { setEnabled(getAction().isEnabled());
setToolTipText((String) (newAction.getValue(Action.SHORT_DESCRIPTION))); setIcon((Icon) newAction.getValue(Action.SMALL_ICON)); setEnabled(this.action.isEnabled());
setToolTipText((String) (newAction.getValue(Action.SHORT_DESCRIPTION))); setIcon((Icon) newAction.getValue(Action.SMALL_ICON)); setEnabled(this.action.isEnabled());
setToolTipText((String) (newAction.getValue(Action.SHORT_DESCRIPTION))); setIcon((Icon) newAction.getValue(Action.SMALL_ICON)); setEnabled(this.action.isEnabled());