使用
CrimeHolder holder1 = (CrimeHolder) mCrimeRecyclerView.findViewHolderForAdapterPosition(1);
然后使用holder1.getxxxx();
但是我在外部调用时提示·······getTitleTextView()' on a null object reference,调试发现holder1为null,求解决方案
调用时机:Fragment的onResume()方法中。
ringa_lee
Not sure, it’s best to add more codeIf it involves related logic after the view layer is created, it’s best to execute it in view.post.
view.post(new Runnable(){ //这里在view加载完毕之后将得到执行 })
Not sure, it’s best to add more code
If it involves related logic after the view layer is created, it’s best to execute it in view.post.