是否可以通过Google Drive API确定该文件夹是否为共享Drive文件夹?
以下是我用来检查代码的代码:
DriveService service = GetService();
var request = service.Files.List();
request.IncludeTeamDriveItems = true;
request.SupportsTeamDrives = true;
IList<File> listFiles = request.Execute().Files;
if (listFiles != null && listFiles.Count > 0)
{
foreach (var file in listFiles)
{
if(file.TeamDriveId == aIdFolder)
{
//Yes It's a shared drive folder
}
}
}
请告知。
答案 0 :(得分:2)
答案 1 :(得分:-1)
建议的解决方案对我有用:
val viewModel: SharedViewModel
by fragment.navGraphViewModels(R.id.feature_nested_graph) { factory2.create(assessmentId) }