android-notifications

Receiving broadcast from notification on Android Oreo

吃可爱长大的小学妹 提交于 2019-12-01 02:59:31
I have a custom button in a sticky notification. I used to attach a PendingIntent to it for receiving button clicks: Intent intent = new Intent(); intent.setAction("com.example.app.intent.action.BUTTON_CLICK"); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 2000, intent, PendingIntent.FLAG_UPDATE_CURRENT); contentViewExpanded.setOnClickPendingIntent(R.id.button, pendingIntent); When i run this code on Oreo , i get BroadcastQueue: Background execution not allowed in logcat and don't receive button click. I registered receiver with manifest: <receiver android:name="

Reminder Functionality

核能气质少年 提交于 2019-12-01 01:10:59
In my application i am trying to set reminder and alarm on that reminder but i am not able to do so. As i don't have complete and proper knowledge of how to set reminder, edit it and delete it. As i searched on google and what i got is not easy to understand for me. I tried a code as: Main.java Calendar cal = Calendar.getInstance(); java.util.Calendar; // add minutes to the calendar object cal.set(Calendar.MONTH, 4); cal.set(Calendar.YEAR, 2011); cal.set(Calendar.DAY_OF_MONTH, 5); cal.set(Calendar.HOUR_OF_DAY, 21); cal.set(Calendar.MINUTE, 43); Intent alarmintent = new Intent

Getting Detail/Expanded Text from an Android Notification?

丶灬走出姿态 提交于 2019-12-01 00:15:56
I've implemented a notification listener to look out for a Gmail notification. I want to collect the expanded text (bigtext) from the notification as shown in the notification below: See "----Forwarded message---", etc. which only appears when the user expands the notification to show the action buttons. This string value does not appear in the notification's "EXTRAS" data... http://developer.android.com/reference/android/app/Notification.html After viewing the above link, I further investigate the bundle (EXTRAS) data. When you debug it and look at the variable, you can find that all

How can I create notification that is different on device and wear?

守給你的承諾、 提交于 2019-11-30 23:01:52
Basically, I am wondering if it is possible to create two different notifications and how - one for Android Device and other for Android Wear? For example: I want to have just setContentText , but on Android device I want setContentTitle and setContentText There is currently no possibility to show notification just on Wear (like setLocalOnly with device only - look for more ). I think the Synchronized Notifications sample that comes with the Android Wear SDK may be useful to look at. It gives three simple types of notifications: (1) A phone-only notification (2) A watch-only notification (3) A

Receiving broadcast from notification on Android Oreo

戏子无情 提交于 2019-11-30 22:49:37
问题 I have a custom button in a sticky notification. I used to attach a PendingIntent to it for receiving button clicks: Intent intent = new Intent(); intent.setAction("com.example.app.intent.action.BUTTON_CLICK"); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 2000, intent, PendingIntent.FLAG_UPDATE_CURRENT); contentViewExpanded.setOnClickPendingIntent(R.id.button, pendingIntent); When i run this code on Oreo , i get BroadcastQueue: Background execution not allowed in logcat

How to animate the progress notification icon

余生长醉 提交于 2019-11-30 22:00:46
I am building the notification progress bar in Service in such a way that is given below : private NotificationManager mNotifyManager; private NotificationCompat.Builder mBuilder; mBuilder = new NotificationCompat.Builder(DownloadService.this) .setSmallIcon(R.drawable.download) .setContentTitle("MayUp") .setContentText("Downloading new tools") .setTicker("Downloading in progress"); mBuilder.setAutoCancel(true); Intent targetIntent = new Intent(DownloadService.this, ListClass.class); TaskStackBuilder stackBuilder = TaskStackBuilder.create(DownloadService.this); // Adds the back stack for the

How to properly clear all notification once clicked?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 21:43:40
问题 I send a few notification on the notification bar, i wanted to clear all of it when one of the notification is clicked. For now I clear one by one by using Flag. I know notificationManager.cancelAll() could clear all the notification but where should i put so that i can trigger once one of the notification is clicked. private static void generateNotification(Context context, String message) { int icon = R.drawable.ic_launcher; long when = System.currentTimeMillis(); NotificationManager

Reminder Functionality

和自甴很熟 提交于 2019-11-30 21:38:52
问题 In my application i am trying to set reminder and alarm on that reminder but i am not able to do so. As i don't have complete and proper knowledge of how to set reminder, edit it and delete it. As i searched on google and what i got is not easy to understand for me. I tried a code as: Main.java Calendar cal = Calendar.getInstance(); java.util.Calendar; // add minutes to the calendar object cal.set(Calendar.MONTH, 4); cal.set(Calendar.YEAR, 2011); cal.set(Calendar.DAY_OF_MONTH, 5); cal.set

How to do notification in android?

假如想象 提交于 2019-11-30 21:22:12
I am doing a helpdesk application on android. I want to implement a notification for unread tickets(customer suggestions or complaints). In iPhone version of this app, even if the app is not open a counter for unread tickets on the app icon itself, is it possible in android. If it so please help me to implement like iPhone otherwise help me to implement normal android notification for unread tickets. Thanks Rasel call this method private void triggerNotification(String s) { CharSequence title = "Hello"; CharSequence message = s; NotificationManager notificationManager; notificationManager =

Background execution not allowed. Android O pendingintent

一世执手 提交于 2019-11-30 19:07:42
I have a service that schedules a pendingintent which starts my notification. However, since Android O I am getting this error. I did some research, and stumbled upon context.registerReceiver , but that does not seem to fix the problem. Error: W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:my.great.package flg=0x4000010 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.googlequicksearchbox.GelStubAppWatcher ``` My pendingintent: Intent myNotification = new Intent("services