You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Hi there,
I made a similar class than this test class and when I build it I get more errors.
First I get "EBean cannot be used on a non static inner element" and then one NullPointerException.
If you comment the @AfterInject annotation you get only the first error (no NullPointerException).
packagehu.simpe.androidannotationstest;
importandroid.app.ListFragment;
importandroid.content.Context;
importandroid.widget.ArrayAdapter;
importorg.androidannotations.annotations.AfterInject;
importorg.androidannotations.annotations.Bean;
importorg.androidannotations.annotations.EBean;
importorg.androidannotations.annotations.EFragment;
/** * Created by Péter Simon on 2014.10.04. */@EFragment(R.layout.fragment_test)
publicclassTestFragmentextendsListFragment {
@BeanprotectedTestAdaptermAdapter;
publicTestFragment() {
// Required empty public constructor
}
@EBeanprotectedstaticclassTestAdapterextendsArrayAdapter<String> {
privatestaticString[] testElements = newString[]{"test1", "test2"};
publicTestAdapter(Contextcontext) {
super(context, android.R.layout.simple_list_item_1);
}
@AfterInjectprotectedvoidafterInject() {
for (StringtestElement : testElements) {
add(testElement);
}
}
}
}
Note: Validating elements
Note: Validating with EFragmentHandler: [hu.simpe.androidannotationstest.TestFragment]
Note: Validating with EBeanHandler: [hu.simpe.androidannotationstest.TestFragment.TestAdapter]
Note: Validating with BeanHandler: [mAdapter]
Note: Validating with AfterInjectHandler: [afterInject()]
Note: Processing root elements
Note: Processing root elements EFragmentHandler: [hu.simpe.androidannotationstest.TestFragment]
Note: Processing enclosed elements
D:\Users\simpe\AndroidAnnotationTest\app\src\main\java\hu\simpe\androidannotationstest\TestFragment.java
Error:(25, 5) error: @org.androidannotations.annotations.EBean cannot be used on a non static inner element
Warning:(26, 22) Element EBeanHandler unvalidated by
Error:(16, 8) error: Something went wrong: Unexpected error in AndroidAnnotations 3.1!
You should check if there is already an issue about it on https://github.com/excilys/androidannotations/search?q=java.lang.NullPointerException&type=Issues
If none exists, please open a new one with the following content and tell us if you can reproduce it or not. Don't forget to give us as much information as you can (like parts of your code in failure).
Java version: javac 1.8.0_20
Javac processors options: androidManifestFile=D:\Users\simpe\AndroidAnnotationTest\app\build\intermediates\manifests\debug\AndroidManifest.xml, resourcePackageName=hu.simpe.androidannotationstest
Stacktrace: java.lang.NullPointerException
at org.androidannotations.handler.AfterInjectHandler.process(AfterInjectHandler.java:51)
at org.androidannotations.handler.AfterInjectHandler.process(AfterInjectHandler.java:27)
at org.androidannotations.process.ModelProcessor.processThrowing(ModelProcessor.java:136)
at org.androidannotations.process.ModelProcessor.process(ModelProcessor.java:120)
at org.androidannotations.AndroidAnnotationProcessor.processAnnotations(AndroidAnnotationProcessor.java:243)
at org.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:185)
at org.androidannotations.AndroidAnnotationProcessor.process(AndroidAnnotationProcessor.java:113)
at
Thrown from: hu.simpe.androidannotationstest.TestFragment.TestAdapter
Element (MethodSymbol):
@org.androidannotations.annotations.AfterInject
protected void afterInject();
Hi there,
I made a similar class than this test class and when I build it I get more errors.
First I get "EBean cannot be used on a non static inner element" and then one NullPointerException.
If you comment the @AfterInject annotation you get only the first error (no NullPointerException).