Java Question Using @RaisesSynchronousEvents annotation

agraham

Expert
Licensed User
Longtime User
I think that I am yet again a victim of my own ignorance having forgotten everything I ever learnt about Java with not using it for six years.

Apparently I need to add the @RaisesSynchronousEvents annotation to some methods in my BasicLibIDE library so that it will work with the rapid debugger.

So I did - like this.
B4X:
    @RaisesSynchronousEvents
   private void raiseuievent(final String eventsub, final Object... args)
   {
       // we need to check the thread we are on at event or call time
       // because we could be newed on main thread and invoked on another
       if (Thread.currentThread() == guithread)
       {
           // use raiseEvent2 to let it run during Activity_Create
           ba.raiseEvent2(this, true, eventsub,false, args);
           return;
       }
       TaskId += 1;
       ba.raiseEventFromDifferentThread(this, this, TaskId, eventsub, false, args);
   }

But this is the result of compiling with SLC, which works fine without the annotations

B4X:
Simple Library Compiler
Starting step: Compiling Java code.
exists: True
exists2: True
javac 1.8.0_192
C:\Users\Andy\Documents\B4A\Projects\Libraries\BasicLibIDE\src\anywheresoftware\b4a\agraham\basiclibide\BasicLibIDE.java:617: error: cannot find symbol
        @RaisesSynchronousEvents
         ^
  symbol:   class RaisesSynchronousEvents
  location: class BasicLibIDE
1 error
I think that maybe there is an import missing as the RaisesSynchronousEvents annotation is not recognised.

Indications of where the stupidity lies please!
 

agraham

Expert
Licensed User
Longtime User
Adding the RaisesSynchronousEvents annotation does not work for me. :( This must be because it only works if it appears in the XML file and so will not work for hidden methods in a library.

It doesn't really matter for this library as the legacy debugger seems to work OK and I don't anticipate needing it very often anyway.
 
Top