Skip to content

Instantly share code, notes, and snippets.

@tolunayozturk
Created September 16, 2020 08:30
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/b9fd3191e977d374e3194839bf26418e to your computer and use it in GitHub Desktop.
Save tolunayozturk/b9fd3191e977d374e3194839bf26418e to your computer and use it in GitHub Desktop.
private void queryReply() {
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;
}
if (mComment == null) {
Log.d(TAG, "comment the file first");
return;
}
Drive drive = buildDrive();
ReplyList response = drive.replies()
.list(fileSearched.getId(), mComment.getId())
.setFields("replies(id,description)")
.execute();
final String text = response.getReplies().toString();
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
tv_replies.setText(text);
}
});
} catch (Exception e) {
Log.d(TAG, "query reply failed" + e.toString());
}
}
}).start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment