mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
1130-g solved
This commit is contained in:
parent
813cb1093e
commit
5133dbaed0
1 changed files with 7 additions and 2 deletions
|
|
@ -71,7 +71,12 @@ public class SettingsFragment extends PreferenceFragment {
|
|||
uploadLimit.setText(uploads + "");
|
||||
uploadLimit.setSummary(uploads + "");
|
||||
uploadLimit.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
int value = Integer.parseInt(newValue.toString());
|
||||
int value;
|
||||
try {
|
||||
value = Integer.parseInt(newValue.toString());
|
||||
} catch(Exception e) {
|
||||
value = 100; //Default number
|
||||
}
|
||||
final SharedPreferences.Editor editor = prefs.edit();
|
||||
if (value > 500) {
|
||||
new AlertDialog.Builder(getActivity())
|
||||
|
|
@ -85,7 +90,7 @@ public class SettingsFragment extends PreferenceFragment {
|
|||
uploadLimit.setSummary(500 + "");
|
||||
uploadLimit.setText(500 + "");
|
||||
} else {
|
||||
editor.putInt(Prefs.UPLOADS_SHOWING, Integer.parseInt(newValue.toString()));
|
||||
editor.putInt(Prefs.UPLOADS_SHOWING, value);
|
||||
editor.putBoolean(Prefs.IS_CONTRIBUTION_COUNT_CHANGED,true);
|
||||
uploadLimit.setSummary(newValue.toString());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue