Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, this is my java file. I hope there is someone who can help me run out of this problem.What i'm trying to do is to integrate DropboxAPI into my apps and i'm keep getting the below problem:

==========================Gradle Error================================================

Error:(39, 41) error: cannot find symbol method metadata(DropboxAPI,int,<null>,boolean,<null>)
Error:(40, 56) error: cannot find symbol variable contents
Error:(41, 32) error: cannot find symbol method fileName()
Error:(53, 34) error: cannot find symbol method obtainMessage()
Error:(57, 16) error: cannot find symbol method sendMessage(Message)

======================================================================================


--------------------------------------my java file------------------------------------
package com.example.user.myapps;

import android.os.AsyncTask;
import android.os.Bundle;
import android.os.DropBoxManager;
import android.os.Message;
import android.os.DropBoxManager.Entry;


import com.dropbox.client2.DropboxAPI;
import com.dropbox.client2.exception.DropboxException;

import java.security.KeyStore;
import java.util.ArrayList;
import java.util.logging.Handler;

/**
* Created by FaiqIkhwan on 4/13/2016.
*/
public class ListFiles extends AsyncTask<void,void,arraylist> {

private String dropboxApi;
private DropboxAPI path;
private Handler handler;

public ListFiles(Handler handler, DropboxAPI path, String dropboxApi) {
this.handler = handler;
this.path = path;
this.dropboxApi = dropboxApi;
}

@Override
protected ArrayList doInBackground(Void... params) {

ArrayList files = new ArrayList();

try {

Entry directory = dropboxApi.metadata(path, 1000, null, true, null);
for (DropBoxManager.Entry entry : directory.contents){
files.add(entry.fileName());
}

}catch (DropboxException e){


}
return files;
}

@Override
protected void onPostExecute(ArrayList result) {
Message message = handler.obtainMessage();
Bundle bundle = new Bundle();
bundle.putStringArrayList("data",result);
message.setData(bundle);
handler.sendMessage(message);
}
}
--------------------------------------------------------------------------------------

What I have tried:

i had googled the problem and nothing is done.
Posted
Updated 12-Apr-16 21:57pm

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900