android-notification-bar

Show video, gif or banner in push notificaion

∥☆過路亽.° 提交于 2021-02-15 07:35:45
问题 I have come across the notification which actively changes the content like banners. AFAIK videos and GIFs are not supported in the notification. How can we achieve this? I have searched and found Custom Notification Layout might the solution. But not quite sure. 来源: https://stackoverflow.com/questions/65773220/show-video-gif-or-banner-in-push-notificaion

Notification custom sound and vibrate not working?

心不动则不痛 提交于 2021-02-11 17:01:52
问题 I have an app that receives notification, all is working. However, the custom sound and vibration is not working. I'm testing it on Android 9 pie. Uri sound = Uri.parse("android.resource://" +getApplicationContext().getPackageName()+ "/" +R.raw.siren); //ContentResolver.SCHEME_ANDROID_RESOURCE + String NOTIFICATION_CHANNEL_ID = "com.example.bantay.bantay.test"; NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationCompat

How can i open Activity when notification click

倾然丶 夕夏残阳落幕 提交于 2020-08-25 08:05:06
问题 I need use notification with click event, i have notification method but this method don't open my activity. My code: private void sendNotification(String msg) { NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setContentTitle("EXX") .setSmallIcon(R.drawable.ic_launcher) .setStyle(new NotificationCompat.BigTextStyle() .bigText(msg)) .setContentText(msg) .setOngoing(true); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); } is this possible, thanks. 回答1

NotificationManager.notify creating notifications that are *initially* missing contentText

拈花ヽ惹草 提交于 2020-06-28 07:25:10
问题 When posting a push notification to the Notifications List/Bar, the .contentText and the .number are initially not displayed (.ticker, .icon and .contentTitle display fine). However, after posting another notification (with a different ID), when the first one gets bumped down in the list, it then displays the content text and number. And then the new one is missing the text, and so on. Since I'm using the millisecond timer to create a unique ID, I don't think it's possible for me to be

How to load Glide cached image in NotificationCompat.Builder.setLargeIcon()?

谁说我不能喝 提交于 2020-01-21 11:48:09
问题 Like this image I am trying to set notification large icon as user profile thumbnail like whatsapp or other chatting apps I have tried Glide.with(context) .asBitmap() .load(messageNotification.getLargeIcon()) .into(new SimpleTarget<Bitmap>() { @Override public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) { builder.setLargeIcon(resource); } }); but it is not working.. Any Help? 回答1: If you set the large icon using glide..the you should also notify the

How to load Glide cached image in NotificationCompat.Builder.setLargeIcon()?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-21 11:47:07
问题 Like this image I am trying to set notification large icon as user profile thumbnail like whatsapp or other chatting apps I have tried Glide.with(context) .asBitmap() .load(messageNotification.getLargeIcon()) .into(new SimpleTarget<Bitmap>() { @Override public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) { builder.setLargeIcon(resource); } }); but it is not working.. Any Help? 回答1: If you set the large icon using glide..the you should also notify the

Notification passes old Intent Extras

元气小坏坏 提交于 2020-01-18 19:41:23
问题 i am creating a notification inside a BroadcastReceiver via this code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon = R.drawable.ic_stat_notification; CharSequence tickerText = "New Notification"; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); notification.defaults |= Notification.DEFAULT_VIBRATE; long[] vibrate = {0,100,200,200

Notification passes old Intent Extras

眉间皱痕 提交于 2020-01-18 19:38:38
问题 i am creating a notification inside a BroadcastReceiver via this code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon = R.drawable.ic_stat_notification; CharSequence tickerText = "New Notification"; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); notification.defaults |= Notification.DEFAULT_VIBRATE; long[] vibrate = {0,100,200,200

Notification passes old Intent Extras

[亡魂溺海] 提交于 2020-01-18 19:37:57
问题 i am creating a notification inside a BroadcastReceiver via this code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon = R.drawable.ic_stat_notification; CharSequence tickerText = "New Notification"; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); notification.defaults |= Notification.DEFAULT_VIBRATE; long[] vibrate = {0,100,200,200

Notification passes old Intent Extras

自作多情 提交于 2020-01-18 19:37:00
问题 i am creating a notification inside a BroadcastReceiver via this code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon = R.drawable.ic_stat_notification; CharSequence tickerText = "New Notification"; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); notification.defaults |= Notification.DEFAULT_VIBRATE; long[] vibrate = {0,100,200,200