【发布时间】:2021-07-22 11:50:13
【问题描述】:
我一直在使用我在网上找到的推送通知构建一个股票应用程序。 {Link}。我遇到了几个问题,我已经找到了答案并修复了......但是我无法弄清楚这里的问题是什么。这是我的 MainActivity 的问题
private fun setupRecyclerView() {
with(recyclerView){
layoutManager = LinearLayoutManager(this@MainActivity)
adapter = mAdapter
addItemDecoration(DividerItemDecoration(recyclerView.context, DividerItemDecoration.VERTICAL))
}
}
我忽略了什么? with 的问题是“没有足够的信息来推断类型变量 R”。 其次是(recyclerView)“未解决的参考:recyclerView”,尽管它在我的布局中声明为@+id/recyclerView
下面的布局
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000"
tools:context=".MainActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
【问题讨论】:
标签: android firebase kotlin pusher