RecycleView RecyclerView.Adapter<T extends BaseAdapter> RecyclerView.ViewHolder<T extends BaseViewHolder> LinearLayoutManager
RecycleView RecyclerView.Adapter RecyclerView.ViewHolder<T extends BaseViewHolder> LinearLayoutManager
RecycleView RecyclerView.Adapter RecyclerView.ViewHolder LinearLayoutManager
RecycleView RecyclerView.Adapter<VH extends ViewHolder> RecyclerView.ViewHolder LinearLayoutManager
Intent(this, NextActivity::class.java).also { intent -> startActivity(intent) }
Intent(this, NextActivity::class.java).apply { put(EXTRA_NEXT, "some data") }.also { intent -> activityStart(intent) }
Intent(this, NextActivity::class.java).apply { putExtra(EXTRA_NEXT, "some data") }.also { intent -> startActivity(intent) }
Intent(this, NextActivity::class.java).apply { put(EXTRA_NEXT, "some data") }.also { intent -> activityStart(intent) }
在build.gradle中:include ':app',':about' ':settings'
在settings.gradle中:include ':app',':about' ':settings'
在settings.gradle中:include ':about',':settings'
在gradle.properties中:include ':app',':about' ':settings'
defaultConfig {
...
minApiVersion 21
targetApiVersion 28
}
defaultConfig {
...
targetSdkVersion 21
testSdkVersion 28
}
defaultConfig {
...
minSdkVersion 21
testApiVersion 28
}
defaultConfig {
...
minSdkVersion 21
targetSdkVersion 28
}
private lateinit var textView: TextView
override fun onCreateView(...): View? {
val root = inflator.inflator(R>layout.fragment_home, container, false)
textView = ??
return root
}
注意:AndroidJUnitRunner允许我们在Android设备上运行JUnit3/4样式的测试。
说明: 在方法"defaultSharedPrefarances(this).getString()"中,传递第二个参数是为了在键不存在时返回它。因此,我们需要传递一个空字符串,在键不存在时返回。