Android Question Problem mit 2 Activity

D

Deleted member 103

Guest
Hi,

2 Activity and a behavior I do not understand. :(

I activate Activity-2 and send it in the background.
1) when I start the app from the display then Activity-2 is open.
2) when I start the app from status bar then Activity-1 open.

Is that correct so or I do something wrong?
Should not be always Activity 2 opened?
 

Attachments

Should not be always Activity 2 opened?
Only one Activity can be in foreground.
I activate Activity-2 and send it in the background.
1) when I start the app from the display then Activity-2 is open.
This is because the starter service reactiivate act2.
2) when I start the app from status bar then Activity-1 open.
This happens because you set Main as the Activity to use in your notification.
 
Upvote 0
@somed3v3loper
thanks for the answer.

@DonManfred
This happens because you set Main as the Activity to use in your notification.
That is when I should change to "Sub Activity Pause" the notification, for example, so?
Activity-Main:
Code:
Sub Activity_Pause (UserClosed As Boolean)
    If UserClosed Then
        StopService(Starter)
        ExitApplication
    Else
        Starter.n.SetInfo("Activity2","", Me)
    End If
End Sub
Activity-2:
Code:
Sub Activity_Pause (UserClosed As Boolean)
    If Not(UserClosed) Then
        Starter.n.SetInfo("Activity2","", Me)
    End If
End Sub

I will just try it. ;)
 
Upvote 0
OK, I've tried, so it does not go!
It's better if I leave the Notification off.
Or is there a different way?
 
Upvote 0

Similar Threads

  • Article Article
Android Code Snippet [B4X] Open PDF
Replies
2
Views
4K
Replies
62
Views
84K
Replies
36
Views
136K
Replies
175
Views
144K
Back
Top