質問編集履歴
3
誤字を削除
title
CHANGED
File without changes
|
body
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
しかし、Edit Contentsを選ぶと、
|
14
14
|
Cannot find DriveId. Are you authorized to view this file?
|
15
15
|
というメッセージが現れるので、そもそもの接続が失敗しているようです。
|
16
|
-
|
16
|
+
|
17
17
|
```ここに言語を入力
|
18
18
|
@Override
|
19
19
|
public void onConnected(Bundle connectionHint) {
|
2
コードを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,12 +12,27 @@
|
|
12
12
|
|
13
13
|
しかし、Edit Contentsを選ぶと、
|
14
14
|
Cannot find DriveId. Are you authorized to view this file?
|
15
|
-
というメッセージが現れるので、
|
15
|
+
というメッセージが現れるので、そもそもの接続が失敗しているようです。
|
16
16
|
ようです。
|
17
|
+
```ここに言語を入力
|
18
|
+
@Override
|
19
|
+
public void onConnected(Bundle connectionHint) {
|
20
|
+
super.onConnected(connectionHint);
|
17
21
|
|
22
|
+
final ResultCallback<DriveIdResult> idCallback = new ResultCallback<DriveIdResult>() {
|
23
|
+
@Override
|
24
|
+
public void onResult(DriveIdResult result) {
|
25
|
+
if (!result.getStatus().isSuccess()) {//isSucessがfalseになっている
|
26
|
+
showMessage("Cannot find DriveId. Are you authorized to view this file?");
|
27
|
+
return;
|
28
|
+
}
|
18
|
-
|
29
|
+
DriveId driveId = result.getDriveId();
|
19
|
-
|
20
|
-
|
30
|
+
DriveFile file = driveId.asDriveFile();
|
31
|
+
new EditContentsAsyncTask(EditContentsActivity.this).execute(file);
|
32
|
+
}
|
33
|
+
};
|
34
|
+
Drive.DriveApi.fetchDriveId(getGoogleApiClient(), EXISTING_FILE_ID)
|
35
|
+
.setResultCallback(idCallback);
|
36
|
+
}
|
37
|
+
```
|
21
|
-
|
38
|
+
どうすれば接続に成功しますか?
|
22
|
-
|
23
|
-
よろしくお願い申し上げます。
|
1
プロジェクト名を修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
android-demos
|
1
|
+
android-demosで、Cannot find DriveId. Are you authorized to view this file?
|
body
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
google drive と androidアプリの連携を勉強しています。
|
4
4
|
|
5
5
|
https://github.com/googledrive
|
6
|
-
において、android-demos
|
6
|
+
において、android-demosというプロジェクトをダウンロードし、
|
7
7
|
実機にて動作させました。
|
8
8
|
|
9
9
|
アプリのホーム画面から、Create a file という選択肢を選んで、
|