Advertisement
Guest User

MainActivity

a guest
Apr 5th, 2020
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.92 KB | None | 0 0
  1.     override fun onActivityCreated(savedInstanceState: Bundle?) {
  2.         super.onActivityCreated(savedInstanceState)
  3.         viewModel = ViewModelProviders.of(this).get(CurrentWeatherViewModel::class.java)
  4.         // TODO: Use the ViewModel
  5.  
  6.         val theTextView = view!!.findViewById<TextView>(R.id.responseApi)
  7.  
  8.         val apiServise = WeatherApiServise()
  9.         responseApi.text = "Current"
  10.  
  11.         btn1.setOnClickListener {
  12.             responseApi.text = "КАКОГО ХУЯ ОНО НЕ РАБОТАЕТ!"
  13.         }
  14.  
  15.         btn2.setOnClickListener {
  16.  
  17.             GlobalScope.launch(Dispatchers.Main) {
  18.  
  19.                 val currentWeatherResponse = apiServise.postLogin("ho", "pofig",DataInf("email@email","qwerty")).await()
  20.                 Log.e("TEST","$currentWeatherResponse.current")
  21.                 responseApi.text = currentWeatherResponse.postResponse.toString()
  22.  
  23.             }
  24.         }
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement