CymChad / CymChad/BaseRecyclerViewAdapterHelper
ViewPager2 中 context 无法初始化
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 24.6k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
如果还是没有找到答案,提问请带上这几个必要信息
- 3.0.4
- viewpager2 上面使用
- mAdapter=xxxxAdapter(listData)
- kotlin.UninitializedPropertyAccessException: lateinit property context has not been initialized
BaseQuickAdapter 中 context 为私有的 lateinit
在 onAttachedToRecyclerView 中
this.context = recyclerView.context
因为我这边想在ViewPager2 上使用Brvah context一直无法初始化
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with BaseQuickAdapter and its onAttachedToRecyclerView entry point, then reproduce the reported setup using ViewPager2, mAdapter=xxxxAdapter(listData), and version 3.0.4. Check when the private lateinit context is accessed relative to attachment; done means the ViewPager2 usage no longer raises UninitializedPropertyAccessException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100