Eamorr
Eamorr

Reputation: 10022

Android: Run App in Background

Greetings,

I'm trying to allow my user to close the app but still maintain a connection which listens for events. An icon should appear in the status bar and when the user clicks on the notification, they are taken back to the app.

Any ideas on how I might go about this?

Many thanks in advance,

Upvotes: 6

Views: 8971

Answers (2)

CommonsWare
CommonsWare

Reputation: 1007534

Use a Service, a Notification, and startForeground(). Here is a sample application from one of my books demonstrating this technique.

Upvotes: 9

Kalendae
Kalendae

Reputation: 2244

I think you want to implement a service. http://developer.android.com/reference/android/app/Service.html

Upvotes: 4

Related Questions