heads-up-notifications

Android Heads-up notification disappears after a few seconds

五迷三道 提交于 2020-08-15 05:52:27
问题 I would that the notification does not disappear after a few seconds. So i have create the notification like this: NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setSmallIcon(R.drawable.cast_ic_notification_small_icon) .setDefaults(Notification.FLAG_ONGOING_EVENT) .setPriority(Notification.PRIORITY_HIGH) .setContentTitle(notificationDetails.getSubject()) .setContentText(notificationDetails.getMessage()) .setColor(context.getResources().getColor(R.color

Setting small icon in Notification above lollipop version

混江龙づ霸主 提交于 2020-07-08 07:10:26
问题 I have created heads up notification. As like below, NotificationCompat.Builder notification = new NotificationCompat.Builder(this, channelId) .setContentTitle("Message") .setContentText("Recieved Successfully") .setContentIntent(pendingIntent) //.setColor(ContextCompat.getColor(this, R.color.green)) .setSmallIcon(R.drawable.notification_icon) .setDefaults(Notification.DEFAULT_ALL) .setContentIntent(pendingIntent) .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))

Setting small icon in Notification above lollipop version

给你一囗甜甜゛ 提交于 2020-07-08 07:09:14
问题 I have created heads up notification. As like below, NotificationCompat.Builder notification = new NotificationCompat.Builder(this, channelId) .setContentTitle("Message") .setContentText("Recieved Successfully") .setContentIntent(pendingIntent) //.setColor(ContextCompat.getColor(this, R.color.green)) .setSmallIcon(R.drawable.notification_icon) .setDefaults(Notification.DEFAULT_ALL) .setContentIntent(pendingIntent) .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))

Dismiss Heads Up notification and create a normal one

旧时模样 提交于 2020-01-23 09:15:56
问题 I'm using this code to create a Heads Up notification. private static void showNotificationNew(final Context context,final String title,final String message,final Intent intent, final int notificationId, final boolean isHeaderNotification) { NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context.getApplicationContext()) .setSmallIcon(R.drawable.prime_builder_icon) .setPriority(Notification.PRIORITY_DEFAULT) .setCategory(Notification.CATEGORY_MESSAGE)

How to cancel an ongoing notification of another app?

若如初见. 提交于 2020-01-12 04:47:26
问题 Background I've found an app that somehow hides heads-up notifications, including even ongoing notifications (used by foreground services), called NCleaner . I was wondering how such a thing works. The problem There isn't much information of how to control notifications of other apps. Only of the current app, and for some reason I've failed to cancel an ongoing notification, but I've succeeded canceling a normal one. What I've found I've found this sample showing how to monitor notifications.

How to detect headsup notification in uiautomator?

空扰寡人 提交于 2019-12-23 10:07:30
问题 I am working with Nexus 5 and Cyanogen One plus devices with Lollipop android OS. I am trying to test various notifications of certain app. I was successfully able to test tray notification and lock screen notification with UiAutomator but I am not able to have any success with headsup notification. I tried following code but it failed to detect it. public void test_HeadsupTitle() throws InterruptedException, UiObjectNotFoundException, IOException { //some code to bring up headsup

Notification Action without starting new Activity?

血红的双手。 提交于 2019-12-23 08:26:13
问题 I plan to have a heads up notification that has two Actions ... one to Approve a login request and one to Decline a login request. By clicking on either of these actions I wish to fire off a HTTP request to my server and most importantly do not want to start a new Activity or have the user redirected to my app at all. Context context = getBaseContext(); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.mipmap.notificationicon) .setContentTitle

Notification Action without starting new Activity?

主宰稳场 提交于 2019-12-23 08:26:02
问题 I plan to have a heads up notification that has two Actions ... one to Approve a login request and one to Decline a login request. By clicking on either of these actions I wish to fire off a HTTP request to my server and most importantly do not want to start a new Activity or have the user redirected to my app at all. Context context = getBaseContext(); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.mipmap.notificationicon) .setContentTitle

Notification without “heads up”

这一生的挚爱 提交于 2019-12-10 10:55:28
问题 I am trying to create a notification that has a high priority (a chatting app) but my client requested that there will be no "heads up" view for it. I have tried creating an empty layout for a RemoteViews to set as the Notification.headsUpContentView but still nothing. Here is what I've tried: Intent target = new Intent(this, PushConsumedBroadcastReceiver.class); target.putExtra(PushConsumedBroadcastReceiver.PUSH_TYPE, PushConsumedBroadcastReceiver.PUSH_TYPE_REMINDER); PendingIntent pending =

Notification without “heads up”

大城市里の小女人 提交于 2019-12-06 08:43:10
I am trying to create a notification that has a high priority (a chatting app) but my client requested that there will be no "heads up" view for it. I have tried creating an empty layout for a RemoteViews to set as the Notification.headsUpContentView but still nothing. Here is what I've tried: Intent target = new Intent(this, PushConsumedBroadcastReceiver.class); target.putExtra(PushConsumedBroadcastReceiver.PUSH_TYPE, PushConsumedBroadcastReceiver.PUSH_TYPE_REMINDER); PendingIntent pending = PendingIntent.getBroadcast(this, Constants.REQUEST_CODE_BASE, target, PendingIntent.FLAG_UPDATE