error: non-static method unbind() cannot be referenced from a static context
error: non-static method unbind() cannot be referenced from a static context
我正在将 Bind 更改为 BindView Class,如何正确编写我不知道,我是编码新手
请帮助我
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import static butterknife.Unbinder.*;
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// TODO Auto-generated method stub code part
View view = inflater.inflate(R.layout.fragment_device_info, container, false);
Unbinder unbinder = ButterKnife.bind(this, view);
mContext = getActivity();
return view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
Unbinder.unbind();
}
请帮帮我
Unbinder unbinder; //declare it here
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
...........
unbinder = ButterKnife.bind(this, view); //bind it here
.......
return view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind(); // then unbind it here on the same Unbinder object
}
我正在将 Bind 更改为 BindView Class,如何正确编写我不知道,我是编码新手 请帮助我
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import static butterknife.Unbinder.*;
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// TODO Auto-generated method stub code part
View view = inflater.inflate(R.layout.fragment_device_info, container, false);
Unbinder unbinder = ButterKnife.bind(this, view);
mContext = getActivity();
return view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
Unbinder.unbind();
}
请帮帮我
Unbinder unbinder; //declare it here
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
...........
unbinder = ButterKnife.bind(this, view); //bind it here
.......
return view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind(); // then unbind it here on the same Unbinder object
}