android-notifications

Incorrect timestamp on future notifications

☆樱花仙子☆ 提交于 2020-02-03 05:26:10
问题 When my application is launched, it performs an API call and then schedules notifications based on the results. This amounts to around ~10 notifications being scheduled. There seems to be an issue with the timestamp displayed on the actual notification being incorrect. Since I am creating these notifications and then scheduling an alarm with an AlarmManager , the default time present on the notification will be the time at which the notification is created ( System.currentTimeMillis() ). I've

Android: AlarmManager used to call a Service to notify the user

我的未来我决定 提交于 2020-02-02 12:32:11
问题 Edit Adding this line in my manifest solved my problem (the Service is well created). <service android:name=".TimersService" > Post I'm currently trying to implement alarms to notify the user that a countdown has finished. I have a method createAlarm() that adds a new Alarm through an AlarmManager . This method is currently called inside a Fragment. It looks like this: private final void createAlarm(String name, long milliInFuture) { Intent myIntent = new Intent(getActivity().getApplication()

Android: AlarmManager used to call a Service to notify the user

女生的网名这么多〃 提交于 2020-02-02 12:31:05
问题 Edit Adding this line in my manifest solved my problem (the Service is well created). <service android:name=".TimersService" > Post I'm currently trying to implement alarms to notify the user that a countdown has finished. I have a method createAlarm() that adds a new Alarm through an AlarmManager . This method is currently called inside a Fragment. It looks like this: private final void createAlarm(String name, long milliInFuture) { Intent myIntent = new Intent(getActivity().getApplication()

How to implement dialog like truecaller

前提是你 提交于 2020-01-30 14:34:20
问题 I am trying to implement the app similar to true caller,I am able to get the phone number when the phone rings using broadcast receiver and opening the MyCustomDialog Activity This is my receiver class by which I am getting the Call State that the call is starts or ends. In this, I make some methods which I am using in CallReceiver.java PhonecallReceiver.java import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.telephony

Trying to build a simple notification in android

别说谁变了你拦得住时间么 提交于 2020-01-24 08:13:34
问题 I'm trying to set a notification in my android app that will simply say "It worked", but I need my app to have compatibility all the way down to API 1. I'm really confused on how to do this though. There are old tutorials that are deprecated, and there are new tutorials that don't support older API levels. According to this SO question, I should use NotificationCompat.Builder. There is an example that I'm using, but I don't fully understand the code. Out of this code: Intent

Trying to build a simple notification in android

我怕爱的太早我们不能终老 提交于 2020-01-24 08:13:30
问题 I'm trying to set a notification in my android app that will simply say "It worked", but I need my app to have compatibility all the way down to API 1. I'm really confused on how to do this though. There are old tutorials that are deprecated, and there are new tutorials that don't support older API levels. According to this SO question, I should use NotificationCompat.Builder. There is an example that I'm using, but I don't fully understand the code. Out of this code: Intent

Did I screw up my System_server service?

限于喜欢 提交于 2020-01-23 12:30:07
问题 My phone is producing a non-stop Log.d output. The following repeats over and over again about 1200 times per second . 04-25 15:58:04.883 1542-5012/? D/NetworkStatsCollection: getHistory:mUID 10266 isVideoCallUID: false PID 1542 is System_server which I've come to understand manages an array of Android services. In the app I'm developing, I use the Alarm Manager and Notification service as seen below. Is there anything I could have done to cause this service to react the way it is? public

Android: Is there a way to disable notification bundling?

你离开我真会死。 提交于 2020-01-23 05:41:07
问题 I have an app where the user can receive multiple notifications for things they need to do. The user has a choice of making some of these notifications persistent (which I achieve by calling NotificationCompat.Builder.setOngoing). At least on my version of Android which is Nougat, when more than three notifications are posted by my app they get bundled together into one notification, which makes all of them dismissible to the user in one swipe. This makes the previously persistent

Strange allow/deny question on Huawei 5.1 phone when showing notification

≯℡__Kan透↙ 提交于 2020-01-21 11:44:09
问题 So it turns out that Huawei phones with 5.1 can't display MediaStyle notifications so while fixing that, I made a very simple notification test and I get a strange question asking Allow App Name to push messages to the notification panel . I don't use push in any way, in fact the screenshot below is for an app that all it does is show a sample notification, nothing else. How can I make it not show that? This is the code: Notification notification = new Notification.Builder

Notification passes old Intent Extras

元气小坏坏 提交于 2020-01-18 19:41:23
问题 i am creating a notification inside a BroadcastReceiver via this code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon = R.drawable.ic_stat_notification; CharSequence tickerText = "New Notification"; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); notification.defaults |= Notification.DEFAULT_VIBRATE; long[] vibrate = {0,100,200,200