Android Question How to start a service with main activity hidden in the background?

toby

Well-Known Member
Licensed User
Longtime User
My test app is a service which starts the main activity. I want the only thing visible is the notification icon which, once touched, will bring the main activity to the foreground. Can someone give some advices on how to achieve that?
 

Peter Simpson

Expert
Licensed User
Longtime User
Look for notifications builder library.

NotificationBuilder
Methods:

  • AddAction (icon As String, title As String, tag AsString, Activity As Object)
    Adds an Action to the notification.
The action in your case would be to start the main activity.
 
Last edited:
Upvote 0
Top