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:
@@ -21,6 +21,7 @@ import android.app.Activity;
|
||||
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;
|
||||
@@ -330,8 +331,11 @@ public class VoiceVariantPreference extends DialogPreference {
|
||||
case DialogInterface.BUTTON_POSITIVE:
|
||||
onDataChanged();
|
||||
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();
|
||||
if (editor != null) {
|
||||
VoiceVariant variant = variants[mCategoryIndex][mVariantIndex].getVariant();
|
||||
|
||||
Reference in New Issue
Block a user