protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
 {
     base.OnActivityResult(requestCode, resultCode, data);
     if (uiExtensionsManager != null)
     {
         uiExtensionsManager.HandleActivityResult(this, requestCode, (int)resultCode, data);
     }
 }
        protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            if (resultCode == Result.Ok)
            {
                if (requestCode == AppStorageManager.OpenTreeRequestCode ||
                    requestCode == MainActivity.REQUEST_SELECT_DEFAULT_FOLDER)
                {
                    if (data == null || data.Data == null)
                    {
                        return;
                    }

                    Uri           uri       = data.Data;
                    ActivityFlags modeFlags = data.Flags & (ActivityFlags.GrantReadUriPermission | ActivityFlags.GrantWriteUriPermission);
                    ContentResolver.TakePersistableUriPermission(uri, modeFlags);
                    LocalModule       localModule    = App.Instance().GetLocalModule(filter);
                    AppStorageManager storageManager = AppStorageManager.GetInstance(ApplicationContext);
                    if (TextUtils.IsEmpty(storageManager.DefaultFolder))
                    {
                        string defaultPath = AppFileUtil.ToPathFromDocumentTreeUri(uri);
                        storageManager.DefaultFolder = defaultPath;
                        App.Instance().CopyGuideFiles(localModule);
                        localModule.SetCurrentPath(defaultPath);
                    }
                    else
                    {
                        localModule.ReloadCurrentFilePath();
                    }
                }
            }

            if (uiExtensionsManager != null)
            {
                uiExtensionsManager.HandleActivityResult(this, requestCode, (int)resultCode, data);
            }
        }