Created
September 16, 2020 08:23
-
-
Save tolunayozturk/eddc66670e5c061797c9563657a83f82 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 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