Hi guys i want try to show notification in android 2.3.x but doesn't work. In Android 4.x this work fine... there is a logcat:
http://paste.ubuntu.com/7648767/
code:
protected void ShowNotification(int icon ,String title, String text){
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(getBaseContext())
.setSmallIcon(icon)
.setContentTitle(title)
.setContentText(text)
.setDefaults(Notification.DEFAULT_ALL) // requires VIBRATE permission
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(text));
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(incMyNum(), mBuilder.build());
Uri alarmSound = RingtoneManager
.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
mBuilder.setSound(alarmSound);
mBuilder.build();
}
in logcat:
06-15 16:20:53.989: E/AndroidRuntime(451): at com...........ShowNotification(DettagliVolo.java:639)
is this:
notificationManager.notify(incMyNum(), mBuilder.build());
AndroidManifest:
<uses-permission android:name="android.permission.VIBRATE" />
In emulator with GB crash... and if i run my application in a emulator with ICS+ work fine! There is a solution? Thank you!
2.Question: is possible show notification default in big mode? (expanded)