What kind of Android notification is this? - android

I have a Service that has to run all the time, so after a long research I think that only way to have it running is use a Foreground Service, and for to use it, I need a notification. The problem starts when I have to set it, that it's always appearing the icon of the notification in the top of the screen and this is very disturbing. There's no problem if the notifications apears when you open the Notification Bar. I have an example of this case:
If you look to the image 1, I have the Facebook's Messenger popup window opened, but no notification there of the app. Ok, but If you see in the image 2 when I expand the bar, there's the notification. What kind of notification is this?
Image1 => https://db.tt/t7fLfGQP
Image2 => https://db.tt/ougBIOiF
Also I tried to set the Notification.PRIORITY_MIN and .SetOngoing(true) but I can't get the desired functionality. Can someone help me, please?

you can do this using setPriority(Notification.PRIORITY_MIN) but here you also add .SetOngoing(true) so Ongoing notifications cannot be manually removed from the notification drawer. so you have to remove this property and Try also get more Detail from here: http://developer.android.com/design/patterns/notifications.html
Thats it...

Related

get rid of AlarmClock icon on status bar for the alarm set using Alarmmanager.AlarmClock()

I have set Alarms using AlarmManager.setAlarmClock(...) method.My alarms were set but, when these alarms were set using it, My device shows AlarmClock icon on top right of the status bar.
whereas I would not like to show that icon over there and would like that to be disappeared.Is there any remedy that does not show icon on status bar.
Googled related to this issue but neither related to my query nor solution to my issue were found.
Please help me out in this regard.Looking forward for a solution to this.
Hope I conveyed clearly else please let me know. :)
Thanks in advance!

How to add splash art to an android notification

I came across this notification while doing some research and it has me wondering... how do you include this splash art in the notification list on Android?
I have not seen an Android app do this before. Checking Google's documentation (https://developer.android.com/preview/notifications.html), I don't see it mentioned.
Any thoughts or ideas on how this is accomplished?
http://postimg.org/image/mtan1vcfn/
You need a custom notification layout via RemoteViews. Have a look at the documentation.
You first create a RemoteViews with your custom layout. This is the normal XML file you are used to. Then call the Notification.Builder.setContent() and pass in your RemoteViews.
And, dont forget to set the small icon for your notification or else it just wont display.

How to show message count in notification

I am using Google's Push notification and I want to show the number of notification in the notification icon, instead of showing the multiple notifications. Something like this -
Is there a method or something in the Notification Class for android?
the Notification class should be used for displaying notifications on the top bar (like the Gmail notifications). From what I understood, you can just use a normal TextView applying some styles to make it look nice and place it inside your screen.
You can select the icon you will display when the notification is created.
With .setsmallIcon() I think.
I also encourage you to implement bigtextviews for JellyBean. NoficationCompat2 is a good library to manage this elegantly on different Android versions.

How to add a button into notification?

I do it like this:
RemoteViews views = new RemoteViews(..);
views.setOnClickPendingIntent(R.id.button1,pd);
noti.contentviews = views;
and then notify the notification.
I can see the button in the notification,
but the button can't be clicked.
When i click the button,the whole notification clicked!
How can i resolve this question?
I found everywhere for this,but nothing useful found.
someone said, some phones don't support the notification button,
but samsung galaxy s, the musicplayer's notification has button click event.
You cannot put interactive widgets, like a Button, in a Notification and get user input from them. These are for output display only.
We can made custom notification and put buttons into that and also can perform different functionality on that onClick function, recently I was stuck in the same problem but this link
Handling buttons inside android notifications
save my life.
You can also see my code here
Adding button action in custom notification
and it actually works on my HTC Sensation XE havent tried on other devices yet. So cheer and good luck

Android: Adding a button on a status bar notification

I am trying to create a custom status bar notification in Android that has a button in addition to the text. The button can do a different thing than when you click the notification itself.
Is this possible at all? I'd also be ok putting an image of a button there instead. I know how to put an image, but not sure how to handle OnClick for an image embedded in RemoteViews. Your help is sincerely appreciated.
Thanks a lot in advance.
I don't think you can get a button on the status bar itself but you can certainly do it using a Custom Expanded View (see http://developer.android.com/guide/topics/ui/notifiers/notifications.html)
try use this way,the first is the view ID,
the second is a Pending intent..
RemoteViews.setOnClickPendingIntent(R.id.push_notifi_content, Pdit);
I have try it,but seems it just support in android4.0
I am working on this end as well. It is straightforward from HoneyComb onwards: look at the music app (it has a status bar control when playing). And you can implement yours with your_notification_remote_view_instance.setOnClickPendingIntent(R.id.a_button_in_notification, pending_intent_to_be_handled_by_a_service); while backing it with a service to handle the intent properly of course. While buttons can be embedded in earlier versions, they don't get focus or click when pressing.

Categories

Resources