Created
February 9, 2018 16:04
-
-
Save kolmakovruslan/f65c55254294f8f8490161dc96b80c84 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Thread(Runnable { | |
| val client = OkHttpClient() | |
| val request = Request.Builder() | |
| .url("https://api.github.com/users/square/repos") | |
| .build() | |
| val response = client.newCall(request).execute() | |
| val responseText = response.body()!!.string() | |
| val repos = Gson().fromJson(responseText, GitHubRepositoryInfo.List::class.java) | |
| android.util.Log.d("Repos", repos.joinToString { it.name }) | |
| }).start() | |
| data class GitHubRepositoryInfo(val name: String) { | |
| class List : ArrayList<GitHubRepositoryInfo>() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment