/** Loads the default values if we have them if not then blank it all out */ private void loadDefaultValues() { try { mNotification.setChecked(pNotify.notify_active); mLed.setChecked(pNotify.led_active); mRinger.setChecked(pNotify.ringer_active); mVibrate.setChecked(pNotify.vibrate_active); mRingtone.setRingtone(Uri.parse(pNotify.ringtone)); mRingVolume.setVolume(pNotify.ringer_vol); if (mNotifyIcon.findIndexOfValue(pNotify.notify_icon) > -1) mNotifyIcon.setValueIndex(mNotifyIcon.findIndexOfValue(pNotify.notify_icon)); if (mLedPattern.findIndexOfValue(pNotify.led_pat) > -1) mLedPattern.setValueIndex(mLedPattern.findIndexOfValue(pNotify.led_pat)); if (mLedColor.findIndexOfValue(pNotify.led_color) > -1) mLedColor.setValueIndex(mLedColor.findIndexOfValue(pNotify.led_color)); if (mVibratePattern.findIndexOfValue(pNotify.vibrate_pat) > -1) mVibratePattern.setValueIndex(mVibratePattern.findIndexOfValue(pNotify.vibrate_pat)); } catch (NullPointerException e) { if (Log.LOGV) Log.e(TAG + "Null pointer exception " + e.getLocalizedMessage().toString()); } catch (RuntimeException e) { } }
private void setParcelData() { try { pNotify.notify_active = mNotification.isChecked(); pNotify.notify_icon = mNotifyIcon.getValue(); pNotify.led_active = mLed.isChecked(); pNotify.led_color = mLedColor.getValue(); pNotify.led_pat = mLedPattern.getValue(); pNotify.ringer_active = mRinger.isChecked(); pNotify.ringtone = mRingtone.getRingtone(); pNotify.ringer_vol = mRingVolume.getVolume(); pNotify.vibrate_active = mVibrate.isChecked(); pNotify.vibrate_pat = mVibratePattern.getValue(); Intent retIntent = new Intent(); retIntent.putExtra("fac.userdelroot.droidprofiles.Notify", pNotify); setResult(RESULT_OK, retIntent); } catch (NullPointerException e) { if (Log.LOGV) Log.e(TAG + "setParcelData null pointer " + e.getLocalizedMessage().toString()); } }