Now I upgraded to version 2.2 but still getting this error message:
B4X:
Compiling code. Error
Error compiling program.
Error description: Process object is expected. {Type=Object,Rank=0} is an Activity object.
Declaring the variable in Sub Globals instead of Sub Process_Globals will solve this problem.
Occurred on line: 75
uptime = obj1.RunStaticMethod("android.os.SystemClock", "uptimeMillis", Null, Null)
Word: null
It's a false error from the compiler relating to the use of null that Erel will need to check.
This works fine when a Reflector is Dimmed in either Globals or Process_Globals
B4X:
Dim uptime, elrealtime As Long
Dim args(0) As Object
Dim types(0) As String
uptime = Obj1.RunStaticMethod("android.os.SystemClock", "uptimeMillis", args, types)
elrealtime = Obj1.RunStaticMethod("android.os.SystemClock","elapsedRealtime", args, types)
Msgbox(uptime, elrealtime)
This works when a Reflector is Dimmed in Globals but gives the compiler error when a Reflector is Dimmed in Process_Globals.
B4X:
Dim uptime, elrealtime As Long
uptime = Obj1.RunStaticMethod("android.os.SystemClock", "uptimeMillis", Null, Null)
elrealtime = Obj1.RunStaticMethod("android.os.SystemClock","elapsedRealtime", Null, Null)
Msgbox(uptime, elrealtime)
Hi! I have also like that problem! How can I access to activity object from sub process_globals.
I want to use camera flash from my widget
I am writing Dim mycam As AdvancedCamera, but there is error Cannot access to activity object from process_globals, but there is nor "sub globals" what should I do?