Hello!
I am creating a class called CAndroidApp.
Among the other things, I am putting in this code:
Now this code is fine in this instance because, well, if the pointer location of the activity has changed, we need to update it, but I would also like to
check whether the Activity object is of the same type.
Saying it in another way:
Imagine you have a "main" activity.
Then you have a "second" activity.
Then you have a service.
Now from the service, you need to switch
activity but only if the one you want is not current.
The equal sign above will only check for pointers,
(memory locations) which may change if an activity is
destroyed and recreated.
Thus, I still need a way to tell if it's the same activity
Anybody has suggestions?
Thanks.
A
I am creating a class called CAndroidApp.
Among the other things, I am putting in this code:
B4X:
'Save activity instance
Dim CurrActivity As Activity
...
'This has the same name, but it's fine because it is in another class
Sub StartActivity( AnActivity As Activity )
If CurrActivity <> AnActivity Then
CurrActivity = AnActivity
End If
StartActivity( AnActivity )
End Sub
Now this code is fine in this instance because, well, if the pointer location of the activity has changed, we need to update it, but I would also like to
check whether the Activity object is of the same type.
Saying it in another way:
Imagine you have a "main" activity.
Then you have a "second" activity.
Then you have a service.
Now from the service, you need to switch
activity but only if the one you want is not current.
The equal sign above will only check for pointers,
(memory locations) which may change if an activity is
destroyed and recreated.
Thus, I still need a way to tell if it's the same activity
Anybody has suggestions?
Thanks.
A