I was creating notification using builder class and using android 4.1 version (API level 16).
But the application is generating exception as
08-28 12:39:00.321: E/AndroidRuntime(2311): java.lang.NoClassDefFoundError: android.app.Notification$Builder
Necessary packages are already imported.
Notification.Builder notification = new Notification.Builder(this);
notification.setSmallIcon(R.drawable.ic_launcher);
notification.setTicker("My Notification");
notification.setContentInfo("New event");
mgr.notify(123, notification.build());
Is there anything wrong in the code? thanks in advance
You need to run you application on a device / emulator with API level >= 11 in order to use the Notification.Builder class.