Nerdworld Member Licensed User Longtime User Jul 31, 2014 #1 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!
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!
DonManfred Expert Licensed User Longtime User Jul 31, 2014 #2 Afaik you cannot access activities from codemodules Upvote 0
Nerdworld Member Licensed User Longtime User Jul 31, 2014 #3 At least this seems to work: http://stackoverflow.com/questions/7869230/implement-global-menu-in-basic4android Upvote 0
At least this seems to work: http://stackoverflow.com/questions/7869230/implement-global-menu-in-basic4android
klaus Expert Licensed User Longtime User Jul 31, 2014 #4 You cannot move from one activity to another one in a code module. You can transmit an activity and activity objects to a code module and modify them, but the calling activity must remain active. Upvote 0
You cannot move from one activity to another one in a code module. You can transmit an activity and activity objects to a code module and modify them, but the calling activity must remain active.
sirjo66 Well-Known Member Licensed User Longtime User Jul 31, 2014 #5 and also...... "New" is a reserved word, I think that you can't use it as an object name Sergio Upvote 0
Nerdworld Member Licensed User Longtime User Jul 31, 2014 #6 sirjo66 said: and also...... "New" is a reserved word, I think that you can't use it as an object name Sergio Click to expand... No, New isn't a reserved word. Klaus already gave the right answer. Upvote 0
sirjo66 said: and also...... "New" is a reserved word, I think that you can't use it as an object name Sergio Click to expand... No, New isn't a reserved word. Klaus already gave the right answer.
sirjo66 Well-Known Member Licensed User Longtime User Jul 31, 2014 #7 Ops, sorry, you are right, I am thinking VB.NET language Upvote 0
Nerdworld Member Licensed User Longtime User Jul 31, 2014 #8 sirjo66 said: Ops, sorry, you are right, I am thinking VB.NET language Click to expand... As a PHP developer, i know what you mean. Upvote 0
sirjo66 said: Ops, sorry, you are right, I am thinking VB.NET language Click to expand... As a PHP developer, i know what you mean.