Android Fragment 中的 Recycler 和 ButterKnitfe 错误
Android Recycler and ButterKnitfe error in Fragment
- ButterKnife.bind(这个)错误
private void bindButterKnife() {
ButterKnife.bind(this);
}
- (this, new ArrayList()) and (new LinearLayoutManager(this));错误
private void setUserRecyclerView() {
mUsersChatAdapter = new UsersChatAdapter(this, new ArrayList<User>());
mUsersRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mUsersRecyclerView.setHasFixedSize(true);
mUsersRecyclerView.setAdapter(mUsersChatAdapter);
}
谁能帮帮我
- 覆盖
onViewCreated
并使用 ButterKnife 作为 ButterKnife.bind(this, view)
使用getActivity()
代替this
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
}
- ButterKnife.bind(这个)错误
private void bindButterKnife() { ButterKnife.bind(this); }
- (this, new ArrayList()) and (new LinearLayoutManager(this));错误
private void setUserRecyclerView() { mUsersChatAdapter = new UsersChatAdapter(this, new ArrayList<User>()); mUsersRecyclerView.setLayoutManager(new LinearLayoutManager(this)); mUsersRecyclerView.setHasFixedSize(true); mUsersRecyclerView.setAdapter(mUsersChatAdapter); }
谁能帮帮我
- 覆盖
onViewCreated
并使用 ButterKnife 作为ButterKnife.bind(this, view)
使用
getActivity()
代替this
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ButterKnife.bind(this, view); }