D daemon Active Member Licensed User Longtime User Oct 28, 2014 #1 I need to pass reference to Main activity to a function (http://www.b4x.com/android/forum/th...support-java-library.28980/page-2#post-284675). How to do that? Using 'Me' seems to pass 'main.getObject()', which is not an activity.
I need to pass reference to Main activity to a function (http://www.b4x.com/android/forum/th...support-java-library.28980/page-2#post-284675). How to do that? Using 'Me' seems to pass 'main.getObject()', which is not an activity.
Erel B4X founder Staff member Licensed User Longtime User Oct 28, 2014 #2 You need to change your method signature and add a BA parameter. The user will not see it. You can then get the activity with BA.activity. You should mark your class with @ActivityObject.
You need to change your method signature and add a BA parameter. The user will not see it. You can then get the activity with BA.activity. You should mark your class with @ActivityObject.