mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 13:38:47 +00:00
Android: fix crash when opening settings on pre-7 devices
This commit is contained in:
@@ -20,6 +20,7 @@ package com.reecedunn.espeak.preference;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.DialogPreference;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.AttributeSet;
|
||||
@@ -115,8 +116,11 @@ public class SeekBarPreference extends DialogPreference implements SeekBar.OnSee
|
||||
String text = Integer.toString(mProgress);
|
||||
callChangeListener(text);
|
||||
if (shouldCommit()) {
|
||||
PreferenceManager preferenceManager = getPreferenceManager();
|
||||
preferenceManager.setStorageDeviceProtected ();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
{
|
||||
PreferenceManager preferenceManager = getPreferenceManager();
|
||||
preferenceManager.setStorageDeviceProtected ();
|
||||
}
|
||||
SharedPreferences.Editor editor = getEditor();
|
||||
editor.putString(getKey(), text);
|
||||
editor.commit();
|
||||
|
||||
Reference in New Issue
Block a user