mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	Show notification when failing to import settings
This commit is contained in:
		| @@ -217,7 +217,7 @@ public class BackupRestoreSettingsFragment extends BasePreferenceFragment { | ||||
|                                     manager.loadSerializedPrefs(file, prefs); | ||||
|                                 } | ||||
|                             } catch (IOException | ClassNotFoundException | JsonParserException e) { | ||||
|                                 showErrorSnackbar(e, "Importing preferences"); | ||||
|                                 createErrorNotification(e, "Importing preferences"); | ||||
|                                 return; | ||||
|                             } | ||||
|                             cleanImport(context, prefs); | ||||
| @@ -290,4 +290,10 @@ public class BackupRestoreSettingsFragment extends BasePreferenceFragment { | ||||
|     private void showErrorSnackbar(final Throwable e, final String request) { | ||||
|         ErrorUtil.showSnackbar(this, new ErrorInfo(e, UserAction.DATABASE_IMPORT_EXPORT, request)); | ||||
|     } | ||||
|     private void createErrorNotification(final Throwable e, final String request) { | ||||
|         ErrorUtil.createNotification( | ||||
|                 requireContext(), | ||||
|                 new ErrorInfo(e, UserAction.DATABASE_IMPORT_EXPORT, request) | ||||
|         ); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| package org.schabi.newpipe.settings.export | ||||
|  | ||||
| import android.content.SharedPreferences | ||||
| import android.util.Log | ||||
| import com.grack.nanojson.JsonArray | ||||
| import com.grack.nanojson.JsonParser | ||||
| import com.grack.nanojson.JsonParserException | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Stypox
					Stypox