Fix a crash if the app is restarted while the edit bookmarks folder database view...
authorSoren Stoutner <soren@stoutner.com>
Fri, 16 Apr 2021 21:04:17 +0000 (14:04 -0700)
committerSoren Stoutner <soren@stoutner.com>
Fri, 16 Apr 2021 21:04:17 +0000 (14:04 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDatabaseViewDialog.kt
app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.kt
app/src/main/res/values-de/strings.xml
app/src/main/res/values-es/strings.xml
app/src/main/res/values-it/strings.xml
app/src/main/res/values-ru/strings.xml

index 676c4d4813e6a216c158373558311c25490d9cc0..d7a742315ee00a84b1e648d36b7760a8aacd975c 100644 (file)
@@ -2055,7 +2055,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
 
                     // Make it so.
                     startActivity(genericFileManagerIntent);
-                } catch (Exception gengericFileManagerException) {
+                } catch (Exception genericFileManagerException) {
                     // Try an alternate file manager.
                     try {
                         // Create an alternate file manager intent.
index 542c463277db0b29cc9b5b54a004c4f4b8a14f14..577e1a39e38e6cd87dcc3e6e05e5fc68f6d88cd3 100644 (file)
@@ -365,7 +365,7 @@ class EditBookmarkDatabaseViewDialog : DialogFragment() {
                     updateSaveButton(currentBookmarkName, currentUrl, currentFolderDatabaseId, currentDisplayOrder)
                 }
 
-                override fun onNothingSelected(parent: AdapterView<*>?) {
+                override fun onNothingSelected(parent: AdapterView<*>) {
                     // Do nothing.
                 }
             }
index e15e29ef6eba698e4a767abd3233bbce90755912..ba538f59db319072c2837bcc952f08dd5a51bbd4 100644 (file)
@@ -349,15 +349,18 @@ class EditBookmarkFolderDatabaseViewDialog : DialogFragment() {
             }
         })
 
-        // Update the save button if the parent folder changes.
-        parentFolderSpinner.onItemSelectedListener = object: OnItemSelectedListener {
-            override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) {
-                // Update the save button.
-                updateSaveButton(bookmarksDatabaseHelper, currentFolderName, currentParentFolderDatabaseId, currentDisplayOrder)
-            }
+        // Wait to set the on item selected listener until the spinner has been inflated.  Otherwise the dialog will crash on restart.
+        parentFolderSpinner.post {
+            // Update the save button if the parent folder changes.
+            parentFolderSpinner.onItemSelectedListener = object: OnItemSelectedListener {
+                override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
+                    // Update the save button.
+                    updateSaveButton(bookmarksDatabaseHelper, currentFolderName, currentParentFolderDatabaseId, currentDisplayOrder)
+                }
 
-            override fun onNothingSelected(parent: AdapterView<*>?) {
-                // Do nothing.
+                override fun onNothingSelected(parent: AdapterView<*>) {
+                    // Do nothing.
+                }
             }
         }
 
index 69479eef5715f40ef061f689e56b8a6256d15840..f654e1585c8cd8866167b9284509e8d568e44d9b 100644 (file)
         <string name="clear_history">Verlauf löschen</string>
     <string name="open">Öffnen</string>
     <string name="downloads">Downloads</string>
+        <string name="no_file_manager_detected">Das System konnte keinen kompatiblen Datei-Manager ermitteln.</string>
     <string name="settings">Einstellungen</string>
     <string name="import_export">Importieren/Exportieren</string>
     <string name="logcat">Logcat</string>
     <string name="previous">Vorheriges</string>
     <string name="next">Nächstes</string>
 
+    <!-- Open Dialog. -->
+    <string name="file_is_mht">Die Datei ist ein MHT-Web-Archiv.</string>
+    <string name="mht_checkbox_explanation">Manchmal müssen MIME-gekapselte HTML-Web-Archive (MHT) manuell festgelegt werden, um korrekt geöffnet zu werden.</string>
+
     <!-- Save Dialogs. -->
     <string name="save_url">URL speichern</string>
     <string name="save_archive">Archiv speichern</string>
index d6de2211bdde4bd1649ae6bb9495ce6c171bf4be..bd828d573d31f2137f6d80be5fe686b7a8c0fc83 100644 (file)
         <string name="clear_history">Borrar historial</string>
     <string name="open">Abrir</string>
     <string name="downloads">Descargas</string>
+        <string name="no_file_manager_detected">El sistema no puede detectar un gestor de archivos compatible.</string>
     <string name="settings">Configuración</string>
     <string name="import_export">Importar/Exportar</string>
     <string name="logcat">Logcat</string>
     <string name="previous">Anterior</string>
     <string name="next">Siguiente</string>
 
+    <!-- Open Dialog. -->
+    <string name="file_is_mht">El archivo es un archivo de web MHT.</string>
+    <string name="mht_checkbox_explanation">A veces se necesita especificar manualmente los archivos web MIME Encapsulated HTML (MHT) para que se abran correctamente.</string>
+
     <!-- Save Dialogs. -->
     <string name="save_url">Guardar URL</string>
     <string name="save_archive">Guardar archivo</string>
index de01192de9d11c1e0bcecc1617d915900f0ddd6e..7e8fc4791963462a58c9a9e507a864ee1180a0e6 100644 (file)
         <string name="clear_history">Elimina cronologia</string>
     <string name="open">Apri</string>
     <string name="downloads">Download</string>
+        <string name="no_file_manager_detected">Il sistema non riesce a trovare un file manager compatibile.</string>
     <string name="settings">Impostazioni</string>
     <string name="import_export">Importa/Esporta</string>
     <string name="logcat">Logcat</string>
     <string name="previous">Precedente</string>
     <string name="next">Successivo</string>
 
+    <!-- Open Dialog. -->
+    <string name="file_is_mht">Questo file è un archivio web MHT.</string>
+    <string name="mht_checkbox_explanation">Talvolta gli archivi web del tipo MIME Encapsulated HTML (MHT) devono essere specificati manualmente per essere aperti correttamente.</string>
+
     <!-- Save Dialogs. -->
     <string name="save_url">Salva URL</string>
     <string name="save_archive">Salva Archivio</string>
index c95de4740605405ce9eb3fdcda5da84ba4d40a23..a2de63731bfac765d792ea185b4d0c95137853f6 100644 (file)
         <string name="clear_history">Очистить историю</string>
     <string name="open">Открыть</string>
     <string name="downloads">Загрузки</string>
+        <string name="no_file_manager_detected">Система не может обнаружить совместимый файловый менеджер.</string>
     <string name="settings">Настройки</string>
     <string name="import_export">Импорт/Экспорт</string>
     <string name="logcat">Logcat</string>
     <string name="previous">Предыдущий</string>
     <string name="next">Следующий</string>
 
+    <!-- Open Dialog. -->
+    <string name="file_is_mht">Файл представляет собой веб-архив MHT.</string>
+    <string name="mht_checkbox_explanation">Иногда для корректного открытия веб-архивов MIME Encapsulated HTML (MHT) необходимо указать вручную.</string>
+
     <!-- Save Dialogs. -->
     <string name="save_url">Сохранить URL</string>
     <string name="save_archive">Сохранить архив</string>