Android & RoboGuice - Inject views on Fragment?

后端 未结 1 1832
耶瑟儿~
耶瑟儿~ 2020-12-11 01:44

I have a fragment that I need to display on the screen. I want to be able to use InjectView to inject my UI elements. InjectView works fine on activities becaus

1条回答
  •  臣服心动
    2020-12-11 01:47

    Injection happens during onViewCreated

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    
        commentEditText.setText("Some comment");
    }
    

    0 讨论(0)
提交回复
热议问题