0
我正在谷歌驅動器integration.i已獲取api訪問鍵使用谷歌控制檯,也完成oauth2 authentication.i已經使用谷歌日曆集成和其工作正常,但當我整合驅動器想要檢索文件列表其返回empty.I不知道什麼是錯的。以下是我的代碼。感謝在高級。谷歌驅動器FileList返回空項
public class RetriveFromDrive extends AsyncTask<Void,Void,Void>
{
List<File> result=new ArrayList<File>();
Files.List request;
@Override
protected Void doInBackground(Void... params) {
try{
// TODO Auto-generated method stub
Log.d("Msg", "Do in Background");
request=gDrive.files().list();
Log.d("Msg", request.toString());
FileList file =request.execute();
result.addAll(file.getItems());
names=new ArrayList<String>();
for (File file1 :result) {
names.add(file1.getTitle());
Log.d("Names", names.toString());
}
}catch(Exception e)
{
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void params) {
// TODO Auto-generated method stub
super.onPostExecute(params);
Log.d("Msg","onPostExecute");
Log.d("Names",names.toString());
}`
是的,但我不明白什麼是應用程序擁有account.please幫助我一點點。 – user2332224
是的,請解釋。我也需要它 – aleXela