AndroidAnnotations how to add init code after onCreate
Asked Answered
A

1

7

If I have an activity defined as:

@EActivity(R.layout.activity_login)
public class LoginActivity extends Activity

This will create the onCreate() method for me, but I have extra init code that I want to go after the onCreate method, how should I do this? I could create my own onCreate method and use an empty @EActivity, but is there a better way?

Arthrospore answered 23/5, 2013 at 15:40 Comment(0)
K
15

Use the @AfterViews annotation to define your own initialization code:

@AfterViews
protected void init() {
    // your custom code
}
Kissiah answered 23/5, 2013 at 18:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.