android-notifications

setLatestEventInfo method cannot be resolved [duplicate]

狂风中的少年 提交于 2019-12-13 00:56:32
问题 This question already has answers here : Cannot Resolve Method setLatestEventInfo (4 answers) Closed 3 years ago . I am trying to implement a reminder feature for my application which is API 23. However, the reminder feature contains an error whereby the method "setLatestEventInfo" cannot be resolved. I have done some researching and it turns out that this method is deprecated in API 23. I know that there are similar questions out there, but the solutions did not work for me. Below are the

Cancel AsyncTask inside ListArrayAdapter and dismiss notification

吃可爱长大的小学妹 提交于 2019-12-12 21:55:33
问题 The aim of the application is to offer a simple way to download and extract a bunch of archives (~200mo), to delete it, and to open it. The download display a notification which display the progress. I'm using a ListView to display every archive that can be downloaded. Each array contain an image, some text, and two buttons (for reading/deleting, downloading, or cancel). The data are retrieved from a json. I've got some issues while I try to cancel the AsyncTask which display the notification

NotificationCompat.Builder() not accepting Channel Id as argument

强颜欢笑 提交于 2019-12-12 19:21:39
问题 I know this question has been asked several times before. But none of the solutions worked for me. That's why I would like to ask the question again. The following line only accepts NotificationCompat.Builder(context) : NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, ADMIN_CHANNEL_ID) // Getting error I have fulfilled: importing android.support.v4.app.NotificationCompat My support libraries version is above 25 implementation group: 'com.android.support

How to make notification dismissible when playing music in background like in Spotify and Google Music

风流意气都作罢 提交于 2019-12-12 18:35:16
问题 Spotify and Google Music allows a user to play music in background allowing also the media notification to be dismissible. When you move one of these apps to background, then pause the playback, you are able to dismiss the media notification. However if you don't dismiss the notification, so it is left in paused state for long time, the System won't kill the "audio service" as the notification is always visible and immediately react to play/pause. As far as I know it is not possible using

Notification Listener Service not started when running in debug mode

拟墨画扇 提交于 2019-12-12 17:45:27
问题 I am building an app using the NotificationListenerService. But always when I run the app in debug mode the Service is not started. I reduced my code to the following: My Acticity: class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val intent = Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS") startActivity(intent) } override fun onResume() { super.onResume()

How to read the facebook notification count in android

岁酱吖の 提交于 2019-12-12 17:27:32
问题 Hi am working on a project in which i need to show the notification. I used "NotificationListenerService" and i struct in the facebook notification account I need to show the notification count in my app. Need to show inside my app " Facebook has 15 notifications.." help me to finish this 回答1: Since v2.4 of the Graph API, you can´t access the notifications (or the unread count) anymore. In other words, what you want to achieve is not possible. Changelog: https://developers.facebook.com/docs

How to stop playing notification sound programmatically on Android

折月煮酒 提交于 2019-12-12 16:15:57
问题 I create notification using notification builder like this: NotificationCompat.Builder builder = new NotificationCompat.Builder(context); String someString = "StackOverflow is the best"; builder.setContentTitle(someString) .setContentIntent(contentIntent) .setLights(0xFF00FF00, 500, 3000) .setPriority(Notification.PRIORITY_MAX) .setAutoCancel(true); Notification notif = builder.build(); Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); if (Build.VERSION.SDK_INT

Notification Not open Activity onCLick

断了今生、忘了曾经 提交于 2019-12-12 14:44:14
问题 I want to create a notification which should open activity when click on it. But when I click on notification activity not open . Here is my code: NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); Intent intent = new Intent(context, MessageReceivedActivity.class); intent.putExtra("payload", payload); intent.setAction(Long.toString(System.currentTimeMillis())); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG

How to launch a notification in conjunction with AlarmManager?

╄→гoц情女王★ 提交于 2019-12-12 12:26:41
问题 I am trying to figure out how I should launch a notification. Creating the notification is not what I am asking, but rather a way to launch it in the background so its unobtrusive and the user can do whatever they were doing. Its for a calendar, a reminder to be exact. It is also important to note I am using AlarmManager . What method should I use to run it in the background. BroadCastReciever , Service , etc. Research I have found also presents a problem with AlarmManager . When the app is

Android notification turn on banner setting programmatically

与世无争的帅哥 提交于 2019-12-12 08:45:43
问题 Is there any ways for turning on the banners setting (display on top of the status bar) in application notification programmatically? <pre><code> // send notification to NotificationManager Notification.Builder notificationBuilder =new Notification.Builder(context); notificationBuilder.setSmallIcon(R.drawable.icon_32x32) .setLargeIcon(bitmap) .setContentTitle("title") .setContentText("content") .setContentIntent(contentIntent) .setAutoCancel(true) .setDefaults(Notification.DEFAULT_ALL)