0

In Android, you can have a service run in the foreground by using the startForeground method. However, this method requires a Notification for the 2nd parameter, meaning that the user will see an icon on the status bar.

Is it possible to run a foreground service without any notification or visual indication to the user?

Johann
  • 27,536
  • 39
  • 165
  • 279
  • then why use Foreground service. use background service... – Dhaval Parmar Apr 25 '13 at 08:29
  • You are aware of what a foreground service is don't you and when it's required? – Johann Apr 25 '13 at 08:30
  • Please be more specific as to why you require a foreground service - the legitimate use-cases for a foreground service are extremely small. There may be an alternative pattern which is more suitable to your requirements. – Mark Allison Apr 25 '13 at 08:30
  • @AndroidDev: then add all this awareness in your question. – Dhaval Parmar Apr 25 '13 at 08:33
  • Excuse me, but the question isn't about whether I require a foreground service or not. Please stick to the question. – Johann Apr 25 '13 at 08:33
  • 1
    @AndroidDev, you **must** provide a notification using foreground `Service` – Vladimir Mironov Apr 25 '13 at 08:35
  • 1
    @AndroidDev yes it is - there may be a much better way of meeting your requirements. If you are not prepared to explain why you need a foreground service, then you probably won't get many helpful responses. – Mark Allison Apr 25 '13 at 08:45

0 Answers0