android-notifications

How can I avoid blinking notification update while changing button

本小妞迷上赌 提交于 2019-12-30 03:40:28
问题 I have a Notification, which supports play,pause forward and back. private static Notification createNotification(String interpret, String title, boolean paused) { // if (builder == null) builder = new NotificationCompat.Builder(context); builder.setPriority(Notification.PRIORITY_MAX); builder.setAutoCancel(false); builder.setContentTitle(title); builder.setContentText(interpret); builder.setOngoing(true); builder.setOnlyAlertOnce(true); builder.setSmallIcon(R.drawable.ic_launcher); builder

Full Screen Notification only showing as a Heads Up

自闭症网瘾萝莉.ら 提交于 2019-12-30 02:42:08
问题 I have been banging my head against the table with this problem for 3 days now, please tell me where I have strayed. When I am getting an incoming VoIP call, I am trying to show a full screen notification, just like the PhoneApp does. I am ok with heads up, if the user is in an immersive activity. However, I am getting only a heads up notification, and never getting a full screen. I need to notification to ignore the lock screen as well. Here is what I am doing: String callJson = call.toJson

How to implement the deprecated methods of Notification

纵然是瞬间 提交于 2019-12-28 01:55:10
问题 I have a small problem but dont understand how to get out of this. I created a class for providing Notifications, but these lines are marked deprecated: ... Notification notification = new Notification(icon, text, time); // deprecated in API level 11 ... notification.setLatestEventInfo(this, title, text, contentIntent); // deprecated in API level 11 ... Alternative methods are: ... Notification noti = new Notification.Builder(mContext) .setContentTitle("New mail from " + sender.toString())

Query regarding Android push notifications

天涯浪子 提交于 2019-12-25 16:48:23
问题 I have an Android app with a working push notification set up. It works currently like this: User gets a push notification When the user taps on the push notification, he is taken to a screen which has the list of all the notifications. It is basically a list view which has all the notifications. Now, want to implement the following: a. When a new notification comes to the user, it has to be displayed on the list view, irrespective of whether a user taps on it. b. I have to indicate the

Query regarding Android push notifications

风格不统一 提交于 2019-12-25 16:48:21
问题 I have an Android app with a working push notification set up. It works currently like this: User gets a push notification When the user taps on the push notification, he is taken to a screen which has the list of all the notifications. It is basically a list view which has all the notifications. Now, want to implement the following: a. When a new notification comes to the user, it has to be displayed on the list view, irrespective of whether a user taps on it. b. I have to indicate the

Android N: checking for DND state changed before updating checkbox preference

瘦欲@ 提交于 2019-12-25 09:03:04
问题 My app sets the ringer mode to silent but with Android N I get a java.lang.SecurityException: Not allowed to change Do Not Disturb state . I followed the steps from this post and the following code will open an activity which contains a toggle button for enabling the permission to change the ringer mode. This activity can be "backed" from without the enabling of the permission. Intent intent = new Intent( android.provider.Settings .ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS); startActivity

Android 7.0/API24: How to check for notification access (Settings.Secure.enabled_notification_listeners)

浪尽此生 提交于 2019-12-25 08:00:10
问题 In Android 6.0/API23 and earlier, the following used to work: String settingEnabled = android.provider.Settings.Secure.getString(this.getContentResolver(), "enabled_notification_listeners"); In Android 7.0 Nougat/API24 this seems to be no longer supported, because the code above returns null . It actually was never mentioned here: https://developer.android.com/reference/android/provider/Settings.Secure.html How do we check if our app has notification access in Android 7.0 Nougat API24? Edit:

android notification works for one object in a loop [duplicate]

喜你入骨 提交于 2019-12-25 07:39:35
问题 This question already has answers here : How to create Multiple statusbar Notifications in android (5 answers) Closed 5 years ago . I have an android service which connects to a server using web service, the service return many json objects, I want to run notification for each object, I did all of that but I have problem which is i just see one notification even thought the server is sending two objects. please look at the for loop,it is obvious that i am calling many notifications, why I

Android Marshmallow sound only Notification?

╄→尐↘猪︶ㄣ 提交于 2019-12-25 07:36:17
问题 In Lollipop and below, you could easily send a sound only notification by omitting the icon, content title and content text when constructing, like so: NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext()); builder.setSound(Uri.parse(ringtone)); notificationManager.notify(9998, builder.build()); In Marshmallow, I'm forced to include at least an icon, or I get a 'no valid small icon' exception. I want to use the Notification system, but don't always want

Starting an Android notification at startup

人走茶凉 提交于 2019-12-25 03:04:20
问题 This question is based off of this previous question of mine: Android - Set notification to never go away I now realize that I need something to be triggered at startup to trigger the notification. From my previous question, it looks like I can take two routes. Either start a service, or use a BroadcastReceiver. I think that starting a service is a little overkill (but what do I know). I am stuck while going with the BroadcastReceiver route. It works in general, but when I take my code for a