使用云端硬盘应用程序和无API将本地文件上传到Google云端硬盘

时间:2017-12-08 17:25:51

标签: android android-intent google-drive-api kotlin android-file

我正在尝试使用已安装的云端硬盘应用程序将本地文件上传到Google云端硬盘。 代码:

    driveIntent.`package` = "com.google.android.apps.docs"
    driveIntent.action = Intent.ACTION_VIEW
    val fileId = File(this.cacheDir.path + "/SensorReport.pdf")
    val url = "https://docs.google.com/file/d/" + fileId
    driveIntent.data = Uri.parse(url)
    driveIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
    startActitivty(driveIntent)

问题是它只显示“Google帐户选择器”对话框,当选择帐户时,对话框将被取消,并且没有通知或云端硬盘应用程序屏幕。

0 个答案:

没有答案
相关问题