tags:

views:

53

answers:

1
Notification notification = new Notification(icon, tickerText, when); 
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); 
notification.defaults |= Notification.DEFAULT_SOUND; 
notification.defaults |= Notification.DEFAULT_VIBRATE; 
notification.defaults |= Notification.DEFAULT_LIGHTS; 
notification.flags |= Notification.FLAG_AUTO_CANCEL; 

notification.flags |= Notification.FLAG_SHOW_LIGHTS; 
notification.ledARGB = 0xff00ff00; 
notification.ledOnMS = 300; 
notification.ledOffMS = 1000; 

Change in manifest :
<uses-permission 
        android:name="android.permission.VIBRATE"></uses-permission> 

I have added the above code. its running without errors. But no effects are seen. Does it run on android 1.5 ???

+1  A: 

You need to wrap this notification setup into a notification manager call.

See some tutorial about notificationmanager

mManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mManager.notify(APP_ID, notification);
Pentium10