notification which will be shown in place other than status

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

notification which will be shown in place other than status

Postby alok_vaish » Wed Dec 02, 2009 8:59 am

hi all

i am developing a shopping cart application. i wants to show a cart icon with the number of items on it. the number will increase when user will add an order to cart. i want to use something like notification -- (in notification on status bar it is possible to show an icon with number on it.) . but in status bar position of icon is not application specific and it also popup a window when dragging it.
for showing the thing in status bar code is as follows--
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
int icon = R.drawable.icon;
CharSequence tickerText = "Hello";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);

Context context = getApplicationContext();
CharSequence contentTitle = "My notification";
CharSequence contentText = "Hello World!";
Intent notificationIntent = new Intent(this, Animation123.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
notification.number = 1;//number we want to show on icon
final int HELLO_ID = 1;

mNotificationManager.notify(HELLO_ID, notification);
if it is possible to show the same thing at position other than status bar ? if yes please tell me how?

Once Poster
Once Poster
Posts: 1
Joined: Mon Oct 26, 2009 6:02 am


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 2 guests