Butterknife가 잘 작동 조각에 작동하지 않는,하지만 난 조각에서 사용하려고 할 때 작동하지 : 이미 view
당신이 돌아 당신이Butterknife 내가 활동에 사용하고 때
public class SettingsFragment extends Fragment {
private static final String TAG = "SettingsFragment";
@BindView(R.id.settings_email) TextView _settingsMail;
@BindView(R.id.settings_password) TextView _passwordMail;
@BindView(R.id.settings_token) TextView _tokenMail;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//returning our layout file
final View view = inflater.inflate(R.layout.fragment_3_settings, container, false);
ButterKnife.bind(this, view);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getContext());
String email = prefs.getString("email", null);
String passwd = prefs.getString("password", null);
String token = prefs.getString("token", null);
_settingsMail.setText(email);
_passwordMail.setText(passwd);
_tokenMail.setText(token);
return inflater.inflate(R.layout.fragment_3_settings, container, false);
}
이유를 반환하는 반환 inflater.inflate (R.layout.fragment_3_settings, 컨테이너, 거짓); 이 단순히보기를 반환해서는 안됩니까? –