谷歌Android驱动器打开文件意图

问题描述:

询问用户使用来选择驱动器帐户的档案谷歌Android驱动器打开文件意图

  IntentSender intentSender = Drive.DriveApi .newOpenFileActivityBuilder() 
      .setMimeType(new String[] { "text/plain", "text/html" }) 
      .build(getGoogleApiClient()); 
    try { 
     startIntentSenderForResult(
       intentSender, REQUEST_CODE_OPENER, null, 0, 0, 0); 
    } catch (SendIntentException e) { 
     Log.w(TAG, "Unable to send intent", e); 
    } 
  1. 如何设置起始默认文件夹,好比说我想要开一个当驱动器文件浏览器打开时,默认由我的应用创建的文件夹?
开始=“2”>

在OpenFileActivityBuilder中使用setActivityStartFolder并为您的文件夹指定DriveId。