{"action":"created","issue":{"url":"https://api.github.com/repos/excilys/androidannotations/issues/1392","labels_url":"https://api.github.com/repos/excilys/androidannotations/issues/1392/labels{/name}","comments_url":"https://api.github.com/repos/excilys/androidannotations/issues/1392/comments","events_url":"https://api.github.com/repos/excilys/androidannotations/issues/1392/events","html_url":"https://github.com/excilys/androidannotations/issues/1392","id":73066404,"number":1392,"title":"RuntimeException with @PreferenceScreen","user":{"login":"Noiseapps","id":6209929,"avatar_url":"https://avatars.githubusercontent.com/u/6209929?v=3","gravatar_id":"","url":"https://api.github.com/users/Noiseapps","html_url":"https://github.com/Noiseapps","followers_url":"https://api.github.com/users/Noiseapps/followers","following_url":"https://api.github.com/users/Noiseapps/following{/other_user}","gists_url":"https://api.github.com/users/Noiseapps/gists{/gist_id}","starred_url":"https://api.github.com/users/Noiseapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noiseapps/subscriptions","organizations_url":"https://api.github.com/users/Noiseapps/orgs","repos_url":"https://api.github.com/users/Noiseapps/repos","events_url":"https://api.github.com/users/Noiseapps/events{/privacy}","received_events_url":"https://api.github.com/users/Noiseapps/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/excilys/androidannotations/labels/Defect","name":"Defect","color":"e10c02"}],"state":"closed","locked":false,"assignee":{"login":"WonderCsabo","id":480485,"avatar_url":"https://avatars.githubusercontent.com/u/480485?v=3","gravatar_id":"","url":"https://api.github.com/users/WonderCsabo","html_url":"https://github.com/WonderCsabo","followers_url":"https://api.github.com/users/WonderCsabo/followers","following_url":"https://api.github.com/users/WonderCsabo/following{/other_user}","gists_url":"https://api.github.com/users/WonderCsabo/gists{/gist_id}","starred_url":"https://api.github.com/users/WonderCsabo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WonderCsabo/subscriptions","organizations_url":"https://api.github.com/users/WonderCsabo/orgs","repos_url":"https://api.github.com/users/WonderCsabo/repos","events_url":"https://api.github.com/users/WonderCsabo/events{/privacy}","received_events_url":"https://api.github.com/users/WonderCsabo/received_events","type":"User","site_admin":false},"milestone":null,"comments":15,"created_at":"2015-05-04T16:32:23Z","updated_at":"2015-05-09T11:38:50Z","closed_at":"2015-05-09T11:38:50Z","body":"Hi,\r\nI've tried to implement the preference screen in my app today and stumbled upon this bug (or am I doing something wrong?) \r\n\r\nI have created a xml file with preferences, and annotated the activity : \r\n``` java\r\n@PreferenceScreen(R.xml.preferences)\r\n@EActivity\r\npublic class SettingsActivity extends PreferenceActivity {\r\n}\r\n``` \r\nand it gives me the error:\r\n\r\n```    \r\nCaused by: java.lang.RuntimeException: This should be called after super.onCreate.\r\n            at android.preference.PreferenceActivity.requirePreferenceManager(PreferenceActivity.java:1439)\r\n            at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:1511)\r\n            at package.name.SettingsActivity_.init_(SettingsActivity_.java:38)\r\n            at package.name.SettingsActivity_.onCreate(SettingsActivity_.java:32)\r\n            at android.app.Activity.performCreate(Activity.java:5990)\r\n```\r\n\r\nI guess the problem is in the generated class:\r\n\r\n``` java\r\n    @Override\r\n    public void onCreate(Bundle savedInstanceState) {\r\n        OnViewChangedNotifier previousNotifier = OnViewChangedNotifier.replaceNotifier(onViewChangedNotifier_);\r\n        init_(savedInstanceState); // that line should be after onCreate (line 32)\r\n        super.onCreate(savedInstanceState);\r\n        OnViewChangedNotifier.replaceNotifier(previousNotifier);\r\n    }\r\n\r\n    private void init_(Bundle savedInstanceState) {\r\n        addPreferencesFromResource(xml.preferences); // line 38\r\n    }\r\n``` \r\n\r\nIs there anyone who can confirm the bug or indicate my mistake (I did everything as in the wiki section, so I think all should be fine)\r\nCheers!"},"comment":{"url":"https://api.github.com/repos/excilys/androidannotations/issues/comments/100467800","html_url":"https://github.com/excilys/androidannotations/issues/1392#issuecomment-100467800","issue_url":"https://api.github.com/repos/excilys/androidannotations/issues/1392","id":100467800,"user":{"login":"WonderCsabo","id":480485,"avatar_url":"https://avatars.githubusercontent.com/u/480485?v=3","gravatar_id":"","url":"https://api.github.com/users/WonderCsabo","html_url":"https://github.com/WonderCsabo","followers_url":"https://api.github.com/users/WonderCsabo/followers","following_url":"https://api.github.com/users/WonderCsabo/following{/other_user}","gists_url":"https://api.github.com/users/WonderCsabo/gists{/gist_id}","starred_url":"https://api.github.com/users/WonderCsabo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WonderCsabo/subscriptions","organizations_url":"https://api.github.com/users/WonderCsabo/orgs","repos_url":"https://api.github.com/users/WonderCsabo/repos","events_url":"https://api.github.com/users/WonderCsabo/events{/privacy}","received_events_url":"https://api.github.com/users/WonderCsabo/received_events","type":"User","site_admin":false},"created_at":"2015-05-09T11:38:50Z","updated_at":"2015-05-09T11:38:50Z","body":"Fixed."}}