activity的方法中用getBaseContext();
Context context=getBaseContext();
在activity中用this即可
FileService fileService=new FileService(this);
public class FileService {
private Context context;
public FileService() {
super();
}
public FileService(Context context) {
this.context=context;
}