M melamoud Active Member Licensed User Longtime User Feb 9, 2013 #1 why cant I pass a view to a sub in a code module ? I get an error that I need to put it in class global ? I want to maintain a list of views, do I have to use class instead ? why ?
why cant I pass a view to a sub in a code module ? I get an error that I need to put it in class global ? I want to maintain a list of views, do I have to use class instead ? why ?
M melamoud Active Member Licensed User Longtime User Feb 9, 2013 #3 thats similar to what I have, I get compilation error if a parameter to a code module sub is a view Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2013 #4 You can pass a view to a code module sub. You cannot however store a view in a process global list as this will cause a memory leak. You can use a class instead. Upvote 0
You can pass a view to a code module sub. You cannot however store a view in a process global list as this will cause a memory leak. You can use a class instead.
M melamoud Active Member Licensed User Longtime User Feb 10, 2013 #5 Thanks.. Why a memory leak? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 12, 2013 #6 Why a memory leak? Click to expand... A view holds a reference to the activity context. If you store it as a process global variable then Android will not be able to kill the activity (when a new one is created or when the system is low on memory). Upvote 0
Why a memory leak? Click to expand... A view holds a reference to the activity context. If you store it as a process global variable then Android will not be able to kill the activity (when a new one is created or when the system is low on memory).