我想從Google雲端硬盤下載文件到我的手機。到目前爲止,我可以從我的應用訪問Google雲端硬盤,但到目前爲止,我只能從Google雲端硬盤中選擇一個文件,但我無法下載它。從手機上的Google雲端硬盤應用中,我可以做到這一點,但我需要從我的應用中執行此操作。如何從Google Drive下載文件到我的手機?
public void openFolder() {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath()
+ "/Android/data/com.google.android.apps.docs/files/");
intent.setDataAndType(uri, "text/mp3");
startActivity(Intent.createChooser(intent, "Open folder"));
}
通過此代碼,我可以通過我的應用訪問Google雲端硬盤。 請幫忙嗎?提前致謝。