android-notifications

Android NotificationListenerService: how to know if user clicked on the notification (opening the related app) or simply deleted it

北城以北 提交于 2019-12-23 23:04:07
问题 I'm working with notifications generated by every app (not only mine) on my Android device (android 5.1.1). By extending NotificationListenerService I'm able to know when a push notification is posted (overriding the "onNotificationPosted" method) and when a notification is removed (overriding the "onNotificationRemoved" method). The problem is that I would like to know how the notification was removed: a) by clicking it (so opening the app) or b) by swyping it (so it is only removed) ? Is it

how to implement notification in android TV

可紊 提交于 2019-12-23 20:16:13
问题 Can it possible to send push notification in Android TV through FCM? If it is possible then how can we send push notification through FCM and how to show it in Android TV? 回答1: Yes, you can send notifications to Android TV, they will arrive to your service. Now that since there is no system tray, there is no default UI got them, so you need to do that yourself, you can't use the default behavior and you can't use notification manager. 回答2: I think notification will appear just as

Default priority of notification channel on Android 8

江枫思渺然 提交于 2019-12-23 20:08:41
问题 I am in the process of changing the target SDK version to 26 and trying to use notification channels. I have some notifications for which I would like to hide the icon in the notification bar. Is this possible by default using Notification channels? Even if I set the channel's importance (and the notification's priority to MIN), the icon is displayed. I can then long click the notification and go to the system settings for notifications in my app. Then click the notification channel and then

how to disable notification small icon?

∥☆過路亽.° 提交于 2019-12-23 17:31:46
问题 How to disable or hide notification small icon ? I know it is mandatory but I want to hide or remove small icon and just show large icon. Notification.Builder builder = new Notification.Builder(FcmIntentService.this).setSmallIcon(R.drawable.notification_small_icon_transparent); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(11, builder.build()); i want something like this google plus notification: 回答1:

Opening notification from lock screen is behaving differently than opening the notification from the notification bar

做~自己de王妃 提交于 2019-12-23 12:29:16
问题 I am facing a strange issue when opening a notification through lock screen. Here is the structure of my application MainActivity - The opening activity of the app. NotificationActivity - The activity opened when the user clicks on a notification. Here is how I am creating the notification val mBuilder = NotificationCompat.Builder(this) .setSmallIcon(R.drawable.notification_icon_background) .setContentTitle("Title") .setContentText("Content") .setPriority(NotificationCompat.PRIORITY_DEFAULT)

On progress seekbar notification not showing in DownloadManager android

狂风中的少年 提交于 2019-12-23 11:46:53
问题 I am downloading the file from webview. But it's not displaying the on going download notification similar to this when using DownloadManager. It just doing in background operation. How to display the status bar notification when downloading is in progress. I can able to get the downloaded file but how to display the on going process in notification? I used "request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE);" but it's not displaying the on going process. Please

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

Is it safe to use Intent.FLAG_ACTIVITY_MULTIPLE_TASK?

我怕爱的太早我们不能终老 提交于 2019-12-23 09:03:09
问题 Background Let's take the next sceneraio: the user uses an app X which has multiple activities (like the gmail app). after navigating the app X a bit, he goes to your app. in your app, you need to start this X app using an intent, to go to a specific activity within it. now the user goes to this specific activity on the app X. the user presses the back button, hoping to go back to your app instead of staying on the app X. another similar scenario: the user navigates on your app between

Android: PendingIntent from Notification doesn't trigger the onCreate() if bringing Activity back on Screen

…衆ロ難τιáo~ 提交于 2019-12-23 07:59:12
问题 guess I'm having some misunderstandigs with the Intent Flags.. What I'm trying to do is, I'm having a radio streaming applications, which has two Activities (PlayerApplication and SettingsScreen). I have a Service.class for Streaming which runs in the background, which holds a Notification as well (you can stop/start playback in the notification-overlay menu and the PlayerApplication). If the User clicks on the Notification, the PlayerApplicationActivity should be com back to screen.

How to poll a webservice at finite interval from android?

坚强是说给别人听的谎言 提交于 2019-12-23 07:57:57
问题 i am developing an android app to show notifications.How can i poll a webservice at finite interval (say 10 min interval) to check for any update and show as notification in android notification panel. 回答1: You do not need a service. I feel like a broken record. In this use case a service will sit there for 95% of the time doing nothing but still using system resources and more importantly drain the battery. Please see my answer on a similar question that uses an Alarm from the AlarmManager: