System Notification Icon

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

System Notification Icon

Postby GeorgesAK » Sun Aug 02, 2009 8:12 pm

Hi,
I'm new to Android development, but managed to create a simple app so far. However, I wanna do something for which I just can't find any documentation (I searched for hours!). I have a notification icon and I would like to add a simple numeric value to it, like some applications do (Battery Status for example).
How is that done?
GeorgesAK
Freshman
Freshman
 
Posts: 3
Joined: Sun Aug 02, 2009 8:09 pm

Top

Postby TheChosen » Mon Aug 03, 2009 11:13 am

They usually create multiple icons. For example one with a battery and 100% one with 90% and so on. Or you create the Bitmap file programmatically by painting the icon and writing text over it. Afterwards you put this created icon in the status bar.

For the custom painting version you will need to look into the Bitmap and Canvas classes.
TheChosen
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 06, 2009 7:18 pm
Location: Germany

Postby GeorgesAK » Tue Aug 04, 2009 5:23 pm

I don't want to use different icons, since the number I want to put is not bounded (it's the number of voicemails). So I would need to dynamically add it to my drawable, preferably in a red cercle on the top right.
GeorgesAK
Freshman
Freshman
 
Posts: 3
Joined: Sun Aug 02, 2009 8:09 pm

Postby TheChosen » Wed Aug 05, 2009 10:36 am

Okay, so you will need to load the base icon into a bitmap, then get its canvas and paint the number and the circle on it.
TheChosen
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 06, 2009 7:18 pm
Location: Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 10 guests