@@ -25,6 +25,7 @@ import android.webkit.WebView
25
25
import android.webkit.WebViewClient
26
26
import android.widget.ImageView
27
27
import android.widget.TextView
28
+ import android.widget.Toast
28
29
import com.simplemobiletools.commons.dialogs.*
29
30
import com.simplemobiletools.commons.extensions.*
30
31
import com.simplemobiletools.commons.helpers.*
@@ -649,7 +650,9 @@ class MainActivity : SimpleActivity() {
649
650
try {
650
651
startActivityForResult(this , PICK_OPEN_FILE_INTENT )
651
652
} catch (e: ActivityNotFoundException ) {
652
- toast(R .string.no_app_found)
653
+ toast(R .string.system_service_disabled, Toast .LENGTH_LONG )
654
+ } catch (e: Exception ) {
655
+ showErrorToast(e)
653
656
}
654
657
}
655
658
}
@@ -852,7 +855,9 @@ class MainActivity : SimpleActivity() {
852
855
try {
853
856
startActivityForResult(this , PICK_EXPORT_FILE_INTENT )
854
857
} catch (e: ActivityNotFoundException ) {
855
- toast(R .string.no_app_found)
858
+ toast(R .string.system_service_disabled, Toast .LENGTH_LONG )
859
+ } catch (e: Exception ) {
860
+ showErrorToast(e)
856
861
}
857
862
}
858
863
}
@@ -877,7 +882,14 @@ class MainActivity : SimpleActivity() {
877
882
type = EXPORT_MIME_TYPE
878
883
putExtra(Intent .EXTRA_TITLE , fileName)
879
884
addCategory(Intent .CATEGORY_OPENABLE )
880
- startActivityForResult(this , PICK_EXPORT_NOTES_INTENT )
885
+
886
+ try {
887
+ startActivityForResult(this , PICK_EXPORT_NOTES_INTENT )
888
+ } catch (e: ActivityNotFoundException ) {
889
+ toast(R .string.system_service_disabled, Toast .LENGTH_LONG )
890
+ } catch (e: Exception ) {
891
+ showErrorToast(e)
892
+ }
881
893
}
882
894
}
883
895
@@ -900,7 +912,14 @@ class MainActivity : SimpleActivity() {
900
912
Intent (Intent .ACTION_GET_CONTENT ).apply {
901
913
addCategory(Intent .CATEGORY_OPENABLE )
902
914
type = EXPORT_MIME_TYPE
903
- startActivityForResult(this , PICK_IMPORT_NOTES_INTENT )
915
+
916
+ try {
917
+ startActivityForResult(this , PICK_IMPORT_NOTES_INTENT )
918
+ } catch (e: ActivityNotFoundException ) {
919
+ toast(R .string.system_service_disabled, Toast .LENGTH_LONG )
920
+ } catch (e: Exception ) {
921
+ showErrorToast(e)
922
+ }
904
923
}
905
924
}
906
925
0 commit comments