Skip to content Skip to sidebar Skip to footer

Android & Roboguice - Inject Views On Fragment?

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 because the view (xml) is

Solution 1:

Injection happens during onViewCreated

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    commentEditText.setText("Some comment");
}

Post a Comment for "Android & Roboguice - Inject Views On Fragment?"