Skip to content

Instantly share code, notes, and snippets.

@tolunayozturk
Created September 16, 2020 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tolunayozturk/38554c9fa56f31f8e5891f77d722450c to your computer and use it in GitHub Desktop.
Save tolunayozturk/38554c9fa56f31f8e5891f77d722450c to your computer and use it in GitHub Desktop.
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