Skip to content

Instantly share code, notes, and snippets.

@tolunayozturk
Created September 16, 2020 08:23
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/eddc66670e5c061797c9563657a83f82 to your computer and use it in GitHub Desktop.
Save tolunayozturk/eddc66670e5c061797c9563657a83f82 to your computer and use it in GitHub Desktop.
private void replyComment() {
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;
}
if (StringUtils.isNullOrEmpty(et_replyComment.getText().toString())) {
Log.d(TAG, "comment is required to reply");
return;
}
Drive drive = buildDrive();
Reply reply = new Reply();
reply.setDescription(et_replyComment.getText().toString());
mReply = drive.replies()
.create(fileSearched.getId(), mComment.getId(), reply)
.setFields("*")
.execute();
if (mReply != null && mReply.getId() != null) {
Log.d(TAG, "reply comment success");
} else {
Log.d(TAG, "reply comment failed");
}
} catch (Exception e) {
Log.d(TAG, "reply comment error", e);
}
}
}).start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment