0
사진을 찍어 Google 드라이브에 저장하려고합니다. "메소드를 해결할 수 없습니다"실행 오류를 어떻게 처리해야할지 모르겠습니다.메소드 실행을 해결할 수 없습니다 (Google 드라이브에 이미지 파일 저장)
private void saveFileToDrive() {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
try {
/*// File's metadata.
File body = new File();
body.setTitle(fileContent.getName());
body.setMimeType("image/jpeg");
// File's binary content
java.io.File fileContent = new java.io.File(fileUri.getPath());
FileContent mediaContent = new FileContent("image/jpeg", fileContent);
*/
// File's content.
java.io.File fileContent = new java.io.File("TESR");
FileContent mediaContent = new FileContent("image/jpeg", fileContent);
// File's metadata.
File body = new File();
body.setTitle(fileContent.getName());
body.setMimeType("image/jpeg");
File file = service.files().insert(body, mediaContent).setOcr(true).execute();
fileid = file.getId();
if (file != null) {
showToast("Photo uploaded: " + file.getTitle() + " with the following id: " + fileid);
startCameraIntent();
}
} catch (UserRecoverableAuthIOException e) {
startActivityForResult(e.getIntent(), REQUEST_AUTHORIZATION);
} catch (IOException e) {
e.printStackTrace();
}
}
});
t.start();
}
나는이 라인에서 오류가 계속 : 내 saveFileToDrive
코드는 다음과 같습니다 나는 또한 그것을 시도 "방법을 확인할 수 없습니다 '(실행)' :
File file =service.files().insert(body,mediaContent).setOcr(true).execute();
오류가 말한다 OCR 부분이없고 작동하지 않았다.
이 오류는 내가 처리 할 수없는 유일한 오류이기 때문에이 오류로 도와주세요. 내 응용 프로그램을 컴파일 할 수 없습니다.