4

I want to show my App Icon in status bar without notification tray/drawer. just like alarm icon shows. I am also making application similar to alarm clock.

I have dig out few questions on stackoverflow, some say it is not possible without notification tray/drawer, but I have seen few apps doing this.

Can any one guide me better?

Thanks

4
  • 2
    "I have seen few apps doing this" -- name any. Commented Aug 13, 2014 at 21:40
  • 2
    Dang, @CommonsWare beat me to the punch. Commented Aug 13, 2014 at 21:42
  • 1
    Here is an app play.google.com/store/apps/… Commented Aug 14, 2014 at 14:58
  • HotSpot Shield app also have this feature Commented Aug 14, 2014 at 16:32

1 Answer 1

2
+50

You gave some alarm clock applications as examples, so I think you can start from understanding what this alarm clock icon in status bar is, and how it is shown there.

I note, that, as you can see, application "Alarm Clock Plus" doesn't set its own icon to status bar, just system icon for alarm.

You can see here how you can manipulate this icon on Pre-Lollipop only:

protected void setStatusBarIcon(boolean enabled) { Intent alarmChanged = new Intent("android.intent.action.ALARM_CHANGED"); alarmChanged.putExtra("alarmSet", enabled); sendBroadcast(alarmChanged); } 

If you can give an example of application that puts its own (different from system alarm icon) icon to status bar (not as notification), it could help to see that it is possible. Unfortunately, I don't think that it is possible.

Even just logically: there are two parts of status bar – user (notifications) and system (other). If system allows to put something to system part – there will be so much useless icons (posted by other applications), and there will be no consistency, and it might break all of the use experience. I think.

Hope it helps

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.