fixed initialization when handling new intent in existing activity
This commit is contained in:
parent
9a0334814e
commit
7ea309de91
1 changed files with 5 additions and 0 deletions
|
@ -14,6 +14,7 @@ class AndroidFileUtils {
|
||||||
Set<StorageVolume> storageVolumes = {};
|
Set<StorageVolume> storageVolumes = {};
|
||||||
Set<Package> _packages = {};
|
Set<Package> _packages = {};
|
||||||
List<String> _potentialAppDirs = [];
|
List<String> _potentialAppDirs = [];
|
||||||
|
bool _initialized = false;
|
||||||
|
|
||||||
AChangeNotifier appNameChangeNotifier = AChangeNotifier();
|
AChangeNotifier appNameChangeNotifier = AChangeNotifier();
|
||||||
|
|
||||||
|
@ -22,6 +23,8 @@ class AndroidFileUtils {
|
||||||
AndroidFileUtils._private();
|
AndroidFileUtils._private();
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
|
if (_initialized) return;
|
||||||
|
|
||||||
separator = pContext.separator;
|
separator = pContext.separator;
|
||||||
storageVolumes = await storageService.getStorageVolumes();
|
storageVolumes = await storageService.getStorageVolumes();
|
||||||
primaryStorage = storageVolumes.firstWhereOrNull((volume) => volume.isPrimary)?.path ?? separator;
|
primaryStorage = storageVolumes.firstWhereOrNull((volume) => volume.isPrimary)?.path ?? separator;
|
||||||
|
@ -32,6 +35,8 @@ class AndroidFileUtils {
|
||||||
picturesPath = pContext.join(primaryStorage, 'Pictures');
|
picturesPath = pContext.join(primaryStorage, 'Pictures');
|
||||||
// from Aves
|
// from Aves
|
||||||
videoCapturesPath = pContext.join(dcimPath, 'Video Captures');
|
videoCapturesPath = pContext.join(dcimPath, 'Video Captures');
|
||||||
|
|
||||||
|
_initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initAppNames() async {
|
Future<void> initAppNames() async {
|
||||||
|
|
Loading…
Reference in a new issue