Because of Android O's new policies, I can't run a background service while my application isn't running in the foreground.

So, I've to run a foreground service - more specifically, a service with an uncomfortable notification.

It's being seen like this below: with a "Watchdog Running" title


But, I want it to be like this below:

enter image description here

Why ?: Because I think that the layout part that has covered the action button is much in hight in contrast to the notification height and it's increasing the total notification height what might not be comfortable to the user.

So my question is, is this a good idea?


PS: It's not very clear what you're asking here. I am assuming that you want to change how the notification looks like and the second image is what you are trying to change it to. I am answering for that. In case I misunderstood, please feel free to clarify so that I can update the answer.

TL; DR - It's not a good idea. Don't do it

Here's why

There's a reason why Android handles actions inside notifications in the expanded view (which opens up only when the user explicitly pulls down on a particular notification) and that reason is to avoid accidental actions.

If you have the STOP action in the notification itself, it becomes prone to accidental taps/clicks while viewing the notifications panel. This will not only lead to an unwanted action, but at the same time clear the notification which would require the user to go back to the app list and reopen the app and then restart the service.

Also, STOP is a negative action and it's best to keep it discrete. This implies that when the user clicks on it, the action is deliberate

| improve this answer | |
  • I see the fact... Didn't think about the matter. – APEXBoi Nov 26 '18 at 12:09
  • Can you tell me any way to reduce the height of the action button layout? – APEXBoi Nov 27 '18 at 8:37
  • Not sure if that's possible. You will need to ask this in the android forum or stack exchange. – Shreyas Tripathy Nov 28 '18 at 5:28

Well, first of all : Look if your users are ok with that way of behaving of your app. They can feel like the app is a little too much trying to get into their life (Which is not good according to the METUX Model).

After that, if your users are ok with that, I think the "STOP" button is a really good way of letting your users stopping your service. But still, you have to check with some users testing that they understand it well and know what they're doing without doing ANY MISTAKE(You never know what happens in a user mind without trying out stuff)

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.