public void getDevice() { String device = android.os.Build.DEVICE.toUpperCase(); try { DeviceType type = Enum.valueOf(DeviceType.class, device); Constants.DEVICE = type.name(); Constants.FORUM = type.getForumUrl(); } catch (IllegalArgumentException e) { message = "Device not found/supported!"; makeToast(message); } }