Google Drive FileList returns empty items
I am working on google drive integration.i have done getting api access
key using google console and also done with oauth2 authentication.i
already used google calendar integration and its working fine but when i
integrating drive which want to retrieving file list its return empty.I
don't know what is wrong.following is my code.Thanks in Advanced.
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());
}`
No comments:
Post a Comment