Fields Summary |
---|
public static final int | VALUE_CREATION_MODE_RESTRICTED |
public static final int | VALUE_CREATION_MODE_WARNING |
public static final int | VALUE_CREATION_MODE_FREE |
public static final int | VALUE_RESUBMISSION_MODE_RESTRICTED |
public static final int | VALUE_RESUBMISSION_MODE_WARNING |
public static final int | VALUE_RESUBMISSION_MODE_FREE |
public static final String | COMPRESS_IMAGE_MODE |
public static final String | CREATION_MODE |
public static final String | MMS_DELIVERY_REPORT_MODE |
public static final String | EXPIRY_TIME |
public static final String | PRIORITY |
public static final String | READ_REPORT_MODE |
public static final String | RESUBMISSION_MODE |
public static final String | SMS_DELIVERY_REPORT_MODE |
public static final String | NOTIFICATION_ENABLED |
public static final String | NOTIFICATION_VIBRATE |
public static final String | NOTIFICATION_SOUND |
public static final String | NOTIFICATION_RINGTONE |
public static final String | AUTO_RETRIEVAL |
public static final String | RETRIEVAL_DURING_ROAMING |
private static final int | MENU_RESTORE_DEFAULTS |
Methods Summary |
---|
public static int | convertContentClass(java.lang.String contentValue)Given the name of a content class, which must be one of the
"pref_entry_values_mms_content_class" values in
"res/values/arrays.xml", return the corresponding ID.
return Integer.parseInt(contentValue);
|
public static int | convertCreationMode(java.lang.String modeName)Given the name of a creation mode, which must be one of the
"pref_entry_values_mms_creation_mode" values in
"res/values/arrays.xml", return the corresponding ID.
if ("creation".equals(modeName)) {
return MessagingPreferenceActivity.VALUE_CREATION_MODE_RESTRICTED;
} else if ("warning".equals(modeName)) {
return MessagingPreferenceActivity.VALUE_CREATION_MODE_WARNING;
} else if ("free".equals(modeName)) {
return MessagingPreferenceActivity.VALUE_CREATION_MODE_FREE;
} else {
throw new IllegalArgumentException("Unknown MMS creation mode.");
}
|
public static int | convertExpiryTime(java.lang.String expiryTimeName)Given the string value of an expiry time from
Sharedpreferences, which must be one of the
"pref_entry_values_mms_expiry" values in
"res/values/arrays.xml", return the corresponding number of
seconds.
return Integer.parseInt(expiryTimeName);
|
public static long | convertMaxMmsSize(java.lang.String maxSize)Given the string value of a maximum size from
Sharedpreferences, which must be one of the
"pref_entry_values_mms_max_size" values in
"res/values/arrays.xml", return the corresponding number of
bytes.
return Long.parseLong(maxSize);
|
public static int | convertPriorityId(java.lang.String priorityValue)Given the name of a priority class, which must be one of the
"pref_entry_values_mms_priority" values in
"res/values/arrays.xml", return the corresponding ID.
if ("low".equals(priorityValue)) {
return PduHeaders.PRIORITY_LOW;
} else if ("medium".equals(priorityValue)) {
return PduHeaders.PRIORITY_NORMAL;
} else if ("high".equals(priorityValue)) {
return PduHeaders.PRIORITY_HIGH;
} else {
throw new IllegalArgumentException("Unknown MMS priority.");
}
|
public static int | convertResubmissionMode(java.lang.String modeName)Given the name of a resubmission mode, which must be one of the
"pref_entry_values_mms_resubmission_mode" values in
"res/values/arrays.xml", return the corresponding ID.
if ("creation".equals(modeName)) {
return MessagingPreferenceActivity.VALUE_RESUBMISSION_MODE_RESTRICTED;
} else if ("warning".equals(modeName)) {
return MessagingPreferenceActivity.VALUE_RESUBMISSION_MODE_WARNING;
} else if ("free".equals(modeName)) {
return MessagingPreferenceActivity.VALUE_RESUBMISSION_MODE_FREE;
} else {
throw new IllegalArgumentException("Unknown MMS resubmission mode.");
}
|
protected void | onCreate(android.os.Bundle icicle)
super.onCreate(icicle);
addPreferencesFromResource(R.xml.preferences);
|
public boolean | onCreateOptionsMenu(android.view.Menu menu)
super.onCreateOptionsMenu(menu);
menu.clear();
menu.add(0, MENU_RESTORE_DEFAULTS, 0, R.string.restore_default);
return true;
|
public boolean | onOptionsItemSelected(android.view.MenuItem item)
switch (item.getItemId()) {
case MENU_RESTORE_DEFAULTS:
restoreDefaultPreferences();
return true;
}
return false;
|
private void | restoreDefaultPreferences()
PreferenceManager.getDefaultSharedPreferences(this)
.edit().clear().commit();
setPreferenceScreen(null);
addPreferencesFromResource(R.xml.preferences);
|