ContentView annotation

suggest change

RoboGuice's @ContentView sets the activity layout, so the activity does not call setContentView itself. @InjectView is also RoboGuice. Both are applied when RoboActivity runs super.onCreate. Skipping that call leaves textView null.

@ContentView(R.layout.myactivity_layout)
public class MyActivity extends RoboActivity {
    @InjectView(R.id.text1) TextView textView;

    @Override
    protected void onCreate(Bundle savedState) {
        super.onCreate(savedState);
        textView.setText("Hello!");
    }
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents