android-notifications

Notification not showing up in Android O despite creating a channel

本秂侑毒 提交于 2019-12-23 07:46:24
问题 This is my code given below. This is unable to create any notifications on Android O, inspite of creating the Notification Channel. private void weatherNotification(WeatherInfo weather) { Intent intent = new Intent(this, WeatherActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0); String temperatureScale = prefs.getUnits().equals("metric") ? getString(R.string.c) : getString(R.string.f); String speedScale = prefs.getUnits().equals("metric") ? getString

Notification using setFullScreenIntent() for BigTextStyle opening Activity automatically

别来无恙 提交于 2019-12-23 06:15:10
问题 I have a very strange issue, I am working on Push Notification and it was successfully implemented but when i have used BigTextStyle in Notification to show a long message in notification area with setFullScreenIntent() method then the issue coming up the Notification opening the Activity automatically which is set in PendingIntent. If I don't use setFullScreenIntent() then notification won't opening Activity automatically the user has to tap or click on Notification to open the Activity set

Android notification refresh activity

倖福魔咒の 提交于 2019-12-23 04:56:34
问题 I have an IntentService starts at 9:00 and repeats every hour. It works with an AsyncTask that creates a BUNDLE. The IntentService have to show an Actvity in a Dialog (like Viber for messages), that shows a portion of datas in this BUNDLE and it have to create a notification that shows the same portion of datas. If the user clicks on the notification, it will start a second activity that shows all datas from BUNDLE. The problem is: the IntentService do his job, shows the activity and creates

Push notification works incorrectly when app is on background or not running

天大地大妈咪最大 提交于 2019-12-23 04:54:36
问题 I am using Firebase Cloud Messaging to send push notifications. Here is my FirebaseMessageService : public class FireBaseMessageService extends FirebaseMessagingService { @Override public void onMessageReceived(RemoteMessage remoteMessage) { Log.e("TAG", "From: " + remoteMessage.getFrom()); Log.e("TAG", "Notification Message Body: " + remoteMessage.getData().get("CardName")+" : "+remoteMessage.getData().get("CardCode")); sendNotification(remoteMessage.getNotification().getBody()); } private

Android : Alarm Notification Issue

时光总嘲笑我的痴心妄想 提交于 2019-12-23 04:26:37
问题 In My application i have set the many Alarm Notification. All are at different date but with the same time. And i am setting it on/off with the help of the toggle Button. Now the Problem is, If i am setting it on then at that time it gives me notification of the previous one from current date. it only appear at once and then all alarm notification works fine. Suppose if i have set the alarm at 12,14,16 date then i set the date as 15 in my device and on the toggle button then it gives me

Q: Change notification icon in Android Studio

我与影子孤独终老i 提交于 2019-12-23 04:12:38
问题 I configured the application icon (Image 1), but the notification icon (Notification sent via Firebase) shows a gray rectangle (Image 2). What is the procedure for changing the notification icon image (Image 2) via Android Studio 2.3 or via script? Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.studioshow.studioshow"> <uses-permission android:name="android.permission.INTERNET" /> <application android

Send data to activity when Firebase notification is clicked in Android

烂漫一生 提交于 2019-12-22 15:11:48
问题 In my application I want use fireBase for notification . I want when click on notification (when app is closed, my mean is app is background ) send data with putExtra to mainActivity . I write below codes, but when click on notification (in app is background) but show me null for getStringExtra ! MyNotificationManager class : public class MyNotificationManager { private Context mCtx; private Uri soundUri; private static MyNotificationManager mInstance; public MyNotificationManager(Context

Onclick listener for Notification buttons in android

余生颓废 提交于 2019-12-22 13:49:33
问题 I have created a notification with a button for API versions more than 16. Notification and button are coming up properly. I would like to dismiss the notification on clicking the button or notification. On clicking the notification the notificiation gets cleared but it is not the same when I click on the button it doesn't do anything. I am not sure how to listen to button click on Notification? Can somebody help me fix this? Look at the screen shot... So when I click on AndroidProject - The

Does Android provide a callback when the clear button on notifications list is clicked

偶尔善良 提交于 2019-12-22 12:37:10
问题 Does Android provide a callback when the clear button on the notification list is clicked ? My app needs to clear some data whenever the notification is clicked or cleared. On clicking I know what to do, but how do I handle the second case ? 回答1: You can set a deleteIntent in the notification object. But haven't played with it yet. public PendingIntent deleteIntent Since: API Level 1 The intent to execute when the status entry is deleted by the user with the "Clear All Notifications" button.

Send argument through PendingIntent of NavDeepLinkBuilder

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 09:55:20
问题 I'm having some difficulties sending an argument through a PendingIntent of a notification using NavDeepLinkBuilder . I'm able to get the destination Activity to launch by clicking the notification, but the Activity 's Intent doesn't contain the argument value that I passed it through the NavDeepLinkBuilder . The Intent instead returns the defaultValue that I set in the nav graph - "noJobId". Notification creation : val notification = NotificationCompat.Builder(context, context.getString(R