Android Question Passing Activity object to code module

Nerdworld

Member
Licensed User
Longtime User
Hey folks!

Currently i'm trying to pass an Activity-object to a code module, using the following code:

B4X:
Misc.SwitchActivity(Activity, Question)

B4X:
Sub SwitchActivity(Act As Activity, New As Activity)
    StartActivity(New)
    Act.Finish
End Sub

Throws an "inconvertable types" error:

B4X:
error: inconvertible types
mostCurrent._misc._switchactivity(mostCurrent.activityBA,mostCurrent._activity,
(anywheresoftware.b4a.objects.ActivityWrapper) 
anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper
(new anywheresoftware.b4a.objects.ActivityWrapper(),
(anywheresoftware.b4a.BALayout)(mostCurrent._question.getObject())));

Thanks in advance for any hints!
 

sirjo66

Well-Known Member
Licensed User
Longtime User
and also......
"New" is a reserved word, I think that you can't use it as an object name
Sergio
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…