Skip to content

Commit

Permalink
Fix bug.
Browse files Browse the repository at this point in the history
解决 getMyInfo 方法无法获取头像缩略图的问题。
  • Loading branch information
lhw5123 committed Jan 5, 2017
1 parent 280538d commit ffa25ec
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/android/JMessagePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,15 @@ public void getMyInfo(JSONArray data, CallbackContext callback) {
try {
String json = mGson.toJson(myInfo);
JSONObject jsonObject = new JSONObject(json);
String avatarPath = "";
if (myInfo.getAvatarFile() != null) {
avatarPath = myInfo.getAvatarFile().getAbsolutePath();
}
String avatarPath = myInfo.getAvatarFile().getAbsolutePath();
myInfo.getAvatarBitmap(new GetAvatarBitmapCallback() {
@Override
public void gotResult(int status, String desc, Bitmap bitmap) {
if (status != 0) {
callback.error(status + ": " + desc);
}
}
});
jsonObject.put("avatarPath", avatarPath);
callback.success(jsonObject.toString());
} catch (JSONException e) {
Expand Down

0 comments on commit ffa25ec

Please sign in to comment.