Created
September 16, 2020 07:57
-
-
Save tolunayozturk/38554c9fa56f31f8e5891f77d722450c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void queryComment() { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
if (mAccessToken == null) { | |
Log.d(TAG, "need to sign in first"); | |
return; | |
} | |
if (fileSearched == null) { | |
Log.d(TAG, "query file first"); | |
return; | |
} | |
Drive drive = buildDrive(); | |
CommentList response = drive.comments() | |
.list(fileSearched.getId()) | |
.setFields("comments(id,description,replies(description))") | |
.execute(); | |
final String text = response.getComments().toString(); | |
MainActivity.this.runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
tv_comments.setText(text); | |
} | |
}); | |
Log.d(TAG, "query comments success"); | |
} catch (Exception e) { | |
Log.d(TAG, "query comments failed " + e.toString()); | |
} | |
} | |
}).start(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment