Я сделал это приложение в Android Studio, используя Kotlin язык. Когда я подал заявку, произошла ошибка.
class HomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
val progressBar = findViewById<ProgressBar>(R.id.pb_home)
val dataSource = NetworkProvider.providesHttpAdapter().create(HomeDataSource::class.java)
dataSource.discoverMovie().enqueue(object : Callback<HomeResponse> {
override fun onResponse(
call: Call<HomeResponse>, response:
Response<HomeResponse>
) {
progressBar.visibility = View.GONE
val results = response.body()?.results
val itemAdapter = findViewById<RecyclerView>(R.id.rv_home)
itemAdapter.addItemDecoration(
DividerItemDecoration(this@HomeActivity,
DividerItemDecoration.VERTICAL))
itemAdapter.adapter = HomeAdapter (results ?: emptyList())
}
override fun onFailure(call: Call<HomeResponse>, t: Throwable) {
Log.e(HomeActivity::class.java.simpleName, "${t.printStackTrace()}")
}
})
}
}
Вот скриншот ошибки: