Your question touches several complex concepts.
Not scared by complexity
Let me expand a bit on what I wish to do, which will
probably make things a notch easier to understand.
What I want to do is, essentially, a singleton class that gets
instantiated in the main activity.
This class will keep track of what activity is currently running
plus several other informations inferred from this very thing,
such as device orientation, plus will interact with one or
more services to gather other information.
This is being done to keep all of the relevant "status"
information in one place.
The Activity object is different than the Main module object (or any other Activity module object).
Mind to expand on this a bit, please?
In order to start an activity you need to use the Main object not the inner UI Activity object.
For example:
StartActivity("Main") 'you can pass a string
'Or
StartActivity(Main) 'or a reference to the module object
You can use the Me object to pass a reference to the module object. This doesn't work in v1.95 but will work in newer versions:
'Class1 module
Sub Class_Globals
Private TargetModule As Object
End Sub
Sub Initialize(Target As Object)
TargetModule = Target
StartActivity(TargetModule)
End Sub
'***************************
'Activity module
Dim c As Class1
c.Initialize(Me)
Are you saying that my StartActivity code should really read
Main.StartActivity(AnActivity) ?
I am wondering because, as far as I could see until now,
StartActivity works like a charm from all of the
activities I've used it into
Then, if you do some "black magic" I don't know, as
long as it works it's fine with me
The reason I want to check which activity is running is
important to make sure that, for example, if a service
receives a request for a picture and the shooting
activity is already running, it doesn't start it again.
Should never happen, but we all know what has been of
what should have never been...
Once I know that all is good, then start the activity.
Get my point?
Regards,
A