Android Question LoadLayout from a module

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I am trying to work out if it's possible to load a layout using a code module.

I know in a Activity I can use the following code to load a Layout in a Activity: Activity.LoadLayout("MyLayoutFileHere")
However I want to be able to load a layout from a code module as many Activity's will be loading this same layout.

Lets say I have 10 Activity's and I have 1 layout file I want to load for each of them when the Activity loads and want to do it from a global location.
The reason I want to do it this way is because I might want to add the layout now, but later on I might make a change and want to add something else as well (or even change my mind and want to load a different layout) and I don't want to go each of the Activity's just to make the change to them all. (rather change it in one location to make it change throughout the app since it's going to be the same for each activity)

Is there a way to do this using a code module or using any other module ?
 

LucaMs

Expert
Licensed User
Longtime User
I state that I have not read everything, I ended patience

From a form you can use CallSubDelayed2, so you can put in any activity a Sub LoadLayout (LayoutFileName as string)
and call it from the module:
CallSubDelayed2 (ActivityName, "LoadLayout", LayoutFileName)

(indeed, even using CallSub2)

[Obviously, in the LoadLayout: you will have:
Activity_LoadLayout (LayoutFileName)]
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
I think I will try Erels way first, seems a simpler way to do it. (something I didn't think of)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…