Empty red circle in Android notification status bar! - java

When I have a status bar notification with a number inside, it shows the number fine. But later if I show another notification to replace this one, with no number, it shows an empty red circle. This circle shouldn't be there. How do I remove the red circle? See image here: http://jump.fm/UYHGV
I've already tried:
notification.number = 0;
and
notification.number = -1;
And forget about canceling notifications first. Since there's no way to query the notification service for existing notifications, I can't detect if the previous one needs to be updated. If I would cancel every time I notify, the user will see the status bar flashing once in a while, which is annoying.
Please advise.
Emmanuel

Hope this help http://code.google.com/p/android/issues/detail?id=7891

Related

Android media player stop playing in service

I already asked about it before, but my question even after edits about my progress of fix this noone answered to it anymore. This is original question:
Android media player stop playing while in background
So in short, I'm making music player app, but mediaPlayer stop sometimes when loading next song. After many tests I find out that it stops at mediaPlayer.prepare() and it won't continue as long as I don't trigger any action on phone like turning on display, volume up/down, click headset button. I'm out of ideas what can be a reason of it.
maybe you need to call prepareasync() instead of prepare().

What happens when a user holds the headset button

I'm trying to find out what happens when a user pushes the media button of headset. I know the phone recognizes holding the button, but when I test it myself and hold the button broadcast will send a ACTION_MEDIA_BUTTON. When I push the button down and release it, I get two broadcasts (one for ACTION_DOWN and one for ACTION_UP). But when I hold it doesn't send anything.
This is how most buttons work for anything. Almost no hardware will tell you when something is being pushed down, just when a change is made.
If you want to know how long a button is held down for, you want to start recording the time using something like System.currentTimeMillis when you receive an ACTION_DOWN message and when you receive an ACTION_UP you can record the end time and then calculate the difference.

Number as icon of notification Android

my problem seems be without (smart) solution... please help
I'm working on app that update a persistent notification with temp and weather description.
The problem is that I want show current temp in notification bar but
mNotification = new Notification.Builder(ctx)
.setTicker(number);
this code show but with auto-hide, the only value data still persist in bar it's smallIcon.
The problem is that setSmallIcon() want a resource (int) to work, this is carzy, there are other options?
I don't want put inside app 100 or more little images with number, it's no sense...
Thank you
No it is not possible according to the current android notification design principle. You are only allowed to add text in the notification area/status bar.

Close notification event in Vaadin Window

I am writing an application in Vaadin that searches for results. A form is used to specify the criteria and a table is used to represent the results.
I also want to show the amount of results found in a Window.Notification of Vaadin.
My problem is that I want the notification to stay there until the user clicks on it so it does not disappear after a few seconds.
If you just enter a large delay time, then if you don't click on these notifications and do several searches, all result notifications will come over each other. So if you then click on them to remove them, you will see the amount of results from your previous search.
This is what I want to avoid.
Notifications are added to the Window and as far as I can see, you can't get a reference to them to update them. So you can't change the current notification if there is already one present. After it is painted it is removed from the LinkedList<Notification> notifications of com.vaadin.ui.Window
One of the things I was looking at is how Vaadin closes the notification after you click on it so that maybe I can do the same before each search so that the previous notification is removed and the new search adds a new notification.
But so far I am unable to find how it is done.
A notification in html is shown as a div. So maybe there is a javascript I could call in Vaadin to remove that div?
Does anyone know how the timer works for closing the notification after the defined delay? Will this call a javascript that I could also call?
If the delay on the notification is -1, it has to be clicked on by the user. Unless the notification is of type TYPE_ERROR_MESSAGE, you have to create a notification object yourself:
Notification message = new Notification("Message", Notification.TYPE_HUMANIZED_MESSAGE);
message.setDelayMsec(-1);
getWindow().showNotification(message);
There is no mechanism in Vaadin to listen for hide events of notifications. You could create your own widget derived from VNotification to transmit this condition back to the server.

Making an Android App (Java) 'Wait' Until Something Finishes

I have this app that originally has you take a picture, shows you a progress bar, and uploads it to a website.
What I want to add is something so that before the progress bar shows, an Intent starts an activity that loads a layout with a dropdown menu that allows you to choose a descriptor for the picture. Following this, once you hit the 'OK' button on this new layout, the program should return back to where it had left off and display the progress bar.
Does anyone have any ideas on how to achieve this?
It seems that all I really want is some way to tell the program to stall for a while to call an intent, and when the user hits 'OK', the code may resume.
You should be using OnActivityResult().. More information on the link below http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)

Categories