I received another error below
main_activity_create (java line: 347)
java.lang.ClassCastException: b4a.example.main cannot be cast to java.lang.Object[]
at b4a.example.main._activity_create(main.java:347)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at b4a.example.main.afterFirstLayout(main.java:106)
at b4a.example.main.access$000(main.java:21)
at b4a.example.main$WaitForLayout.run(main.java:84)
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:7223)
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)
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
NativeMe.InitializeContext
End If
Dim s As Boolean = NativeMe.RunMethod("isMockLocationOn",NativeMe)
Msgbox(s,"") 'will print Hello World!
End Sub
#If JAVA
import android.provider.Settings ;
import android.provider.Settings.Secure;
import android.content.Context;
import android.test.mock.MockContext;
public boolean isMockLocationOn(Context context) {
if (Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ALLOW_MOCK_LOCATION).equals("0"))
return false;
else
return true;
}
#End If