I create a simple class with an event to test creating a Library.
I can't seem to have events show up in IDE, and I get a 'missing RaiseSynchronousEvents' reported in Logs.
Can anyone explain this to me? I can get the results I want from the library, but I can't see the event in the IDE, and the 'missing RaiseSynchronousEvents' suggests somethign is not right!
Thanks!
***************************************************************
My class , compiled to a library, is as follows:
#Event: Click (val as Int)
Sub Class_Globals
Dim m_callback As Object
Dim m_CallingName As String
End Sub
'Initializes the object. Calling name is the Dim name of this object. ie Dim x as clsTestLibrary. 'x' is the calling name
'Class returns a calculated value by CallSub2(m_callback, m_CallingName & "_Click", val)
Public Sub Initialize(CallBack As Object, CallingName As String)
m_callback = CallBack
m_CallingName = CallingName
End Sub
Public Sub Init(val1 As Int, val2 As Int)
Dim val3 As Int
val3 = val1 * val2
SendReturnValue(val3)
End Sub
Sub SendReturnValue(val As Int)
If SubExists(m_callback, m_CallingName & "_Click") Then
CallSub2(m_callback, m_CallingName & "_Click", val)
End If
End Sub
**************************************************************
My Main activity used to create and test the Library is as follows:
#Region Project Attributes
#ApplicationLabel: Test Library
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#LibraryAuthor:
#LibraryName: TestLibrary2
#LibraryVersion: 1
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private bt1 As Button
Private et1 As EditText
Private et2 As EditText
Private lbl1 As Label
Dim myLib As clsTestLibrary
Dim val1 As Int, val2 As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
Activity.Title = Application.LabelName
myLib.Initialize(Me,"myLib")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub et2_TextChanged (Old As String, New As String)
val2 = New
End Sub
Sub et1_TextChanged (Old As String, New As String)
val1 = New
End Sub
Sub bt1_Click
myLib.Init(val1,val2)
End Sub
Sub myLib_Click(val As Int)
lbl1.Text = val
End Sub
When I run it I get the the label to display the anwer, but the log reports as follows:
*******************************************************************
** Activity (main) Resume **
Timeline: Activity_idle id: [email protected] time:930445
#3 mView = null
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
Timeline: Activity_idle id: [email protected] time:931804
ViewPostImeInputStage processPointer 0
ViewPostImeInputStage processPointer 1
Unexpected event (missing RaiseSynchronousEvents): lib2_click
Check the unfiltered logs for the full stack trace.
java.lang.Throwable: stack dump
at java.lang.Thread.dumpStack(Thread.java:490)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:306)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1051)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:993)
at sw.TestLibrary2.clstestlibrary._sendreturnvalue(clstestlibrary.java:65)
at sw.TestLibrary2.clstestlibrary._init(clstestlibrary.java:46)
at sw.libtest2.main._btn1_click(main.java:414)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5714)
at android.widget.TextView.performClick(TextView.java:10926)
at android.view.View$PerformClick.run(View.java:22589)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
** Activity (main) Pause, UserClosed = false **
updateVisibility : ActivityRecord{503bf94 [email protected] {sw.libtest2/sw.libtest2.main}} show : false
** Activity (main) Resume **
Timeline: Activity_idle id: [email protected] time:939968
ViewPostImeInputStage processKey 0
ViewPostImeInputStage processKey 1
** Activity (main) Pause, UserClosed = true **
#3 mView = null
-1 received
writer error
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1988)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:357)
at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
at java.lang.Thread.run(Thread.java:818)
Starting remote logger. Port: 10898
********************************************************************
I then created a new app and loaded the library . Main activity is as follows:
#Region Project Attributes
#ApplicationLabel: Library Test 2
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private btn1 As Button
Private lbl1 As Label
Private lib2 As clsTestLibrary
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main2")
lib2.Initialize(Me,"lib2")
Activity.Title = Application.LabelName
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btn1_Click
lib2.Init(5,5)
End Sub
Sub lib2_Click(val As Int)
lbl1.Text = val
End Sub
********************************************************************
I cannot see the Lib2_Click envent in the IDE, but again get the calculated value in lbl1.
Log reports:
Unexpected event (missing RaiseSynchronousEvents): lib2_click
Check the unfiltered logs for the full stack trace.
java.lang.Throwable: stack dump
at java.lang.Thread.dumpStack(Thread.java:490)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:306)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1051)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:993)
at sw.TestLibrary2.clstestlibrary._sendreturnvalue(clstestlibrary.java:65)
at sw.TestLibrary2.clstestlibrary._init(clstestlibrary.java:46)
at sw.libtest2.main._btn1_click(main.java:414)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5714)
at android.widget.TextView.performClick(TextView.java:10926)
at android.view.View$PerformClick.run(View.java:22589)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
** Activity (main) Pause, UserClosed = false **
updateVisibility : ActivityRecord{503bf94 [email protected] {sw.libtest2/sw.libtest2.main}} show : false
** Activity (main) Resume **
Timeline: Activity_idle id: [email protected] time:939968
ViewPostImeInputStage processKey 0
ViewPostImeInputStage processKey 1
** Activity (main) Pause, UserClosed = true **
#3 mView = null
-1 received
writer error
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1988)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:357)
at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
at java.lang.Thread.run(Thread.java:818)
Starting remote logger. Port: 10898
After accept
I can't seem to have events show up in IDE, and I get a 'missing RaiseSynchronousEvents' reported in Logs.
Can anyone explain this to me? I can get the results I want from the library, but I can't see the event in the IDE, and the 'missing RaiseSynchronousEvents' suggests somethign is not right!
Thanks!
***************************************************************
My class , compiled to a library, is as follows:
#Event: Click (val as Int)
Sub Class_Globals
Dim m_callback As Object
Dim m_CallingName As String
End Sub
'Initializes the object. Calling name is the Dim name of this object. ie Dim x as clsTestLibrary. 'x' is the calling name
'Class returns a calculated value by CallSub2(m_callback, m_CallingName & "_Click", val)
Public Sub Initialize(CallBack As Object, CallingName As String)
m_callback = CallBack
m_CallingName = CallingName
End Sub
Public Sub Init(val1 As Int, val2 As Int)
Dim val3 As Int
val3 = val1 * val2
SendReturnValue(val3)
End Sub
Sub SendReturnValue(val As Int)
If SubExists(m_callback, m_CallingName & "_Click") Then
CallSub2(m_callback, m_CallingName & "_Click", val)
End If
End Sub
**************************************************************
My Main activity used to create and test the Library is as follows:
#Region Project Attributes
#ApplicationLabel: Test Library
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#LibraryAuthor:
#LibraryName: TestLibrary2
#LibraryVersion: 1
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private bt1 As Button
Private et1 As EditText
Private et2 As EditText
Private lbl1 As Label
Dim myLib As clsTestLibrary
Dim val1 As Int, val2 As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
Activity.Title = Application.LabelName
myLib.Initialize(Me,"myLib")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub et2_TextChanged (Old As String, New As String)
val2 = New
End Sub
Sub et1_TextChanged (Old As String, New As String)
val1 = New
End Sub
Sub bt1_Click
myLib.Init(val1,val2)
End Sub
Sub myLib_Click(val As Int)
lbl1.Text = val
End Sub
When I run it I get the the label to display the anwer, but the log reports as follows:
*******************************************************************
** Activity (main) Resume **
Timeline: Activity_idle id: [email protected] time:930445
#3 mView = null
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
Timeline: Activity_idle id: [email protected] time:931804
ViewPostImeInputStage processPointer 0
ViewPostImeInputStage processPointer 1
Unexpected event (missing RaiseSynchronousEvents): lib2_click
Check the unfiltered logs for the full stack trace.
java.lang.Throwable: stack dump
at java.lang.Thread.dumpStack(Thread.java:490)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:306)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1051)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:993)
at sw.TestLibrary2.clstestlibrary._sendreturnvalue(clstestlibrary.java:65)
at sw.TestLibrary2.clstestlibrary._init(clstestlibrary.java:46)
at sw.libtest2.main._btn1_click(main.java:414)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5714)
at android.widget.TextView.performClick(TextView.java:10926)
at android.view.View$PerformClick.run(View.java:22589)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
** Activity (main) Pause, UserClosed = false **
updateVisibility : ActivityRecord{503bf94 [email protected] {sw.libtest2/sw.libtest2.main}} show : false
** Activity (main) Resume **
Timeline: Activity_idle id: [email protected] time:939968
ViewPostImeInputStage processKey 0
ViewPostImeInputStage processKey 1
** Activity (main) Pause, UserClosed = true **
#3 mView = null
-1 received
writer error
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1988)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:357)
at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
at java.lang.Thread.run(Thread.java:818)
Starting remote logger. Port: 10898
********************************************************************
I then created a new app and loaded the library . Main activity is as follows:
#Region Project Attributes
#ApplicationLabel: Library Test 2
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private btn1 As Button
Private lbl1 As Label
Private lib2 As clsTestLibrary
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main2")
lib2.Initialize(Me,"lib2")
Activity.Title = Application.LabelName
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btn1_Click
lib2.Init(5,5)
End Sub
Sub lib2_Click(val As Int)
lbl1.Text = val
End Sub
********************************************************************
I cannot see the Lib2_Click envent in the IDE, but again get the calculated value in lbl1.
Log reports:
Unexpected event (missing RaiseSynchronousEvents): lib2_click
Check the unfiltered logs for the full stack trace.
java.lang.Throwable: stack dump
at java.lang.Thread.dumpStack(Thread.java:490)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:306)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1051)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:993)
at sw.TestLibrary2.clstestlibrary._sendreturnvalue(clstestlibrary.java:65)
at sw.TestLibrary2.clstestlibrary._init(clstestlibrary.java:46)
at sw.libtest2.main._btn1_click(main.java:414)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5714)
at android.widget.TextView.performClick(TextView.java:10926)
at android.view.View$PerformClick.run(View.java:22589)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
** Activity (main) Pause, UserClosed = false **
updateVisibility : ActivityRecord{503bf94 [email protected] {sw.libtest2/sw.libtest2.main}} show : false
** Activity (main) Resume **
Timeline: Activity_idle id: [email protected] time:939968
ViewPostImeInputStage processKey 0
ViewPostImeInputStage processKey 1
** Activity (main) Pause, UserClosed = true **
#3 mView = null
-1 received
writer error
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1988)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:357)
at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
at java.lang.Thread.run(Thread.java:818)
Starting remote logger. Port: 10898
After accept