Thx
@Erel
Tried the advice provided.
It now works with the standard example project.
When I add in support for Page Change Listening, the error recurs.
Dim jo As JavaObject = TabStrip1
Dim event As Object = jo.CreateEventFromUI("android.support.v4.view.ViewPager.OnPageChangeListener", "PageChangeListener", Null)
jo.GetFieldJO("tabStrip").RunMethod("setOnPageChangeListener", Array(event))
Sub PageChangeListener_Event (MethodName As String, Args() As Object) As Object
'Log("Method: " & MethodName)
If MethodName = "onPageSelected" Then
Log("Method: " & MethodName)
Dim ArgsList As List = Args
Log ("Index: "&ArgsList.Get(0))
'Log("Args: " & ArgsList)
End If
'Log("Current Position: "¤tPosition)
Return Null
End Sub
Here is the error:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
after
Error occurred on line: 74 (Main)
java.lang.ClassNotFoundException: android.support.v4$view$ViewPager$OnPageChangeListener
at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:288)
at anywheresoftware.b4j.object.JavaObject.createEvent(JavaObject.java:252)
at anywheresoftware.b4j.object.JavaObject.CreateEventFromUI(JavaObject.java:222)
at b4a.example3.main$ResumableSub_Activity_Create.resume(main.java:661)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1705)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
** Activity (main) Pause, UserClosed = true **
This is the line 74 referred to in the error:
Dim event As Object = jo.CreateEventFromUI("android.support.v4.view.ViewPager.OnPageChangeListener", "PageChangeListener", Null)
I have tried to run the Jetifier but it gives me the following:
And the file is in the Additional Libraries folder:
Any other suggestions?