Created
July 23, 2018 13:21
-
-
Save zerogdev/607a77cc607a35dd67c5d6d622625df4 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
public void loadShortUrl(String url, final ShortUrlCallBack callBack) { | |
Call<ShortUrlResult> call = mNaverService.getShortUrl(url); | |
call.enqueue(new Callback<ShortUrlResult>() { | |
@Override | |
public void onResponse(Call<ShortUrlResult> call, Response<ShortUrlResult> response) { | |
if (callBack != null) { | |
if (response.body() != null) { | |
callBack.onShortUrlSuccess(response.body().getResult()); | |
} else { | |
callBack.onShortUrlFail(); | |
} | |
} | |
} | |
@Override | |
public void onFailure(Call<ShortUrlResult> call, Throwable t) { | |
if (callBack != null) { | |
callBack.onShortUrlFail(); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment