Created
March 7, 2020 12:54
-
-
Save mitsinsar/29567fb66e4e4348dbe862ff0bb5266c 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
class MainActivity : AppCompatActivity() { | |
private val service = RetrofitClient.getUniService() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
GlobalScope.launch(Dispatchers.IO) { | |
val result = service.getFoodList().data | |
val foodItems = Gson().fromJson(result, FoodItems::class.java) | |
Log.e("result", foodItems.items.toString()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment