android-notifications

Cancel button on Notification to remove Notification

点点圈 提交于 2019-12-24 08:12:53
问题 I have a Notification that has a Progress Bar and a Cancel button. I am using Thread to increment the Progress Bar and the Cancel button is supposed to clear the notification. Here's the code for Notification remoteViews = new RemoteViews(getPackageName(), R.layout.customnotification); Intent intent = new Intent(this, LocationBroadcastReceiver.class); intent.putExtra("CancelServiceAndNotification","CancelServiceAndNotification"); intent.putExtra("ID",1); PendingIntent pendingIntent =

Android notification rebuilds instead of updating?

旧城冷巷雨未停 提交于 2019-12-24 07:28:10
问题 I'm downloading a file and i want to keep the user informed about the progress so i created a notification.The problem is that the notification keeps getting rebuild instead of updating. I searched for similar behaviours online and i did as they said but my problem persists. Everybody is saying to use a notification builder so the first time it builds the whole notification and then only updates what i tell it to.Tried it,still not working. Here i'm declaring the notification and the

Notification every day at the same time

有些话、适合烂在心里 提交于 2019-12-24 06:46:14
问题 What I want I want a notification every day at the same time. I already read some posts and tutorials/examples but it won't work correctly. Version 1 The Error: Android process / service dies every ~3 minutes after re/starting 11-07 07:33:05.725 4611 6121 I ActivityManager: Process at.htl3r.appmosphere (pid 5238) has died. 11-07 07:33:05.725 4611 6121 W ActivityManager: Scheduling restart of crashed service at.htl3r.appmosphere/.notify.NotifyService in 14648ms 11-07 07:33:20.400 4611 4632 I

android GCM receiver triggered after install and sending empty notif

ε祈祈猫儿з 提交于 2019-12-24 03:52:48
问题 I have class that inheritance NotificationHandler from azure in my project. Everything works fine before i update my project (without any changes in the receiver). Now, every time i install the application, the NotificationHandler always triggered and send empty notification. I think my problem similiar with this question . this is the source code <receiver android:name="com.microsoft.windowsazure.notifications.NotificationsBroadcastReceiver" android:permission="com.google.android.c2dm

how to correct a 'Instrumentation run failed due to 'java.lang.IllegalArgumentException''

∥☆過路亽.° 提交于 2019-12-24 02:31:05
问题 I am working on a course project that deals with notifications,Asynctasks, and broadcast Recievers. i have three tests to run, the first test fails with the stack trace error of: Test failed to run to completion. Reason: 'Instrumentation run failed due to 'java.lang.IllegalArgumentException''. Check device logcat for details the Logcat is huge. if you can tell me what i might be looking for i can narrow it with the tag: function. the other two tests run just fine. below is the first class

Notification sound from URI parse does not work

时光毁灭记忆、已成空白 提交于 2019-12-24 02:21:21
问题 There are at least 7 questions on Stackoverflow related to this, I have tried every single suggestion and solution multiple times and none of them have worked. Here is my latest attempt: private Notification createNotification() { Notification notification = new Notification(); if(notifyImage=="food") { notification.icon = R.drawable.food; notification.sound = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://com.example.memoryGuide/raw/start"); } else { notification.icon = R.drawable

Show Notification at particular time with AlarmManager

折月煮酒 提交于 2019-12-24 02:09:54
问题 I need to display a notification daily at particular time (for example: 4.25PM). I am using AlarmManager and Notification . I set the alarm on landing page of the application. I also have implemented the BroadcastReceiver for it. Code to set the alarm: Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 16); calendar.set(Calendar.MINUTE, 25); calendar.set(Calendar.SECOND, 0); Intent notificationmassage = new Intent(getApplicationContext(),Notificationmassage.class);

TransactionTooLargeException on Samsung S7

喜你入骨 提交于 2019-12-24 00:57:07
问题 one of my apps is throwing the following exception on an Samsung S7: java.lang.RuntimeException: at android.app.NotificationManager.notifyAsUser (NotificationManager.java:342) at android.app.NotificationManager.notify (NotificationManager.java:292) at android.app.NotificationManager.notify (NotificationManager.java:276) at org.mypapp.test.service.NotificationReceiverRemoteViews.updateNotification (NotificationReceiverRemoteViews.java:202) at org.mypapp.test.service

Android wear - Notification - Image Span is not working

梦想的初衷 提交于 2019-12-24 00:23:13
问题 I am using ImageSpan in Android wear notification for styling in notification, but it's not working. Please tell me the procedure how to use ImageSpan in notifications any help is Appreciated. Following sample code i'm using. SpannableStringBuilder title = new SpannableStringBuilder(); title.setSpan(new ImageSpan(context, bmp, ImageSpan.ALIGN_BASELINE),title.length()+2,title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); Thanks in advance. 回答1: You can not use ImageSpan in Notification. If

Xamarin Android - Update UI control of one activity from another activity

吃可爱长大的小学妹 提交于 2019-12-23 23:41:03
问题 I have one Fragment "AddNewIncomeFragment " with a TextView("@+id/lblAccountHead"). On click on textview it starts a new activity "AccountHeadListActivit" which shows a list of existing Account Head. On selection of account head from "AccountHeadListActivity" i want to update "lblAccountHead" of first activity with selected account name, other values need to be intact. Earlier i did it using "messaging center" for xamarin form. Now i trying to do the same in xamarin native(android). ****