android-notifications

How to update Notification

走远了吗. 提交于 2019-12-08 04:48:27
问题 I have a Notification in my android application. And this Notification has a progress bar. My question is: if I update progress in the progress bar of my Notification , should I pass the SAME instance of Notification or create a new instance of Notification ? should I do this: mNotification = new Notification(..); // create in the constructor of my activity getNotificationManager().notify(TAG, FILE_UPLOAD_ID, mNotification); or getNotificationManager().notify(TAG, FILE_UPLOAD_ID, new

Decide what touching Notification icon does

旧巷老猫 提交于 2019-12-08 04:11:48
问题 I have a scenario where I want to display a message which i show in the notification box to a new screen when the notification box is touched. I am able to generate the notification on the cell phone but when I touch the notification box I am unable to display that notification message instead some old message is being displayed. Can someone help me with it. Below is code for the Activity I want to start: public class MainActivity extends Activity { // label to display gcm messages TextView

Call service method from notification with BroadcastReceiver in Xamarin Android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 03:30:48
问题 I start a service and create new thread (downloading a large file). At the same time I display a notification with action (pause button). When I press this button "WSTRZYMAJ" I want call PauseDownload() method from my service. How can I do this? I have read about BroadcastReceiver, create this class but how to call method from service from BroadcastReceiver class? Screen from notification: Fragment of my service: class DownloadsService : Service { DownloadsBroadcastReceiver receiver;

Android to PC notifications platform

随声附和 提交于 2019-12-08 03:17:07
问题 I want to write an Android app that would send notifications from the mobile device to a client application installed on a PC. The notifications would contain data that would be parsed by the client. The notifications are one way only. Or in other words: "Send data notifications from one device to another, sharing the same user account" What would be the best notifications/messaging platform to implement such behavior? Some requirements: Use existing [free] server infrastructure (gtalk?)

Pending Intent created in Native Extension works only from Notification but not within Service

独自空忆成欢 提交于 2019-12-08 00:52:14
问题 I’m developing an Air mobile application for Android which uses Air Native Extensions (ANE). From the ANE I call a function that creates a Pending Intent which is passed to a Notification. Next, the native function starts a service and passes it the Pending Intent and the Notification. Here’s the code for that part: public class StartServiceFunction implements FREFunction { @Override public FREObject call(FREContext context, FREObject[] args) { Log.d("MyApplicationStartServiceFunction", "call

NotificationCompat2 Error: java.lang.IllegalArgumentException

那年仲夏 提交于 2019-12-08 00:31:21
问题 I am trying to use NotificationCompat2 by JakeWharton. The doumentation of NotificationCompat2 says Simple change your import from android.support.v4.app.NotificationCompat to com.jakewharton.notificationcompat2.NotificationCompat2 and use the NotificatonCompat2.Builder class. I have changed the import to com.jakewharton.notificationcompat2.NotificationCompat2 and using the following code Notification notification = new NotificationCompat2.Builder( MainActivity.this).setContentTitle("Basic

Firebase Cloud Messaging, issues in receiving notification

半世苍凉 提交于 2019-12-07 23:43:08
问题 I'm trying to write an application to receive notifications via Firebase Cloud Messaging. It initially worked when I tried to send the message via Firebase console but then the moment I tried doing the same using php webservice, in response, it showed success but I neither received the message nor am I able to get any more notifications via firebase console. Please help My server side code: MainActivity.java package com.example.mojojojo.firebasenotifications; import android.content

Working with Firebase Push Notifications without Notification channels

假如想象 提交于 2019-12-07 21:51:01
问题 I need to generate notifications when a PUSH notification is received but also I need to generate notifications (for display them in the notification bar of the device) when something happens in the application, so I'm using NotificationCompat.Builder for it. As you know, android has deprecated this call to Notification.Builder: Notification.Builder (Context context) And now you must use this call: NotificationCompat.Builder (Context context, String channelId) What happens if you don't want

How to use typeface in notification?

冷暖自知 提交于 2019-12-07 17:31:48
问题 Is it possible to use typeface in notification message, so that I can change the font? I have searched all over internet but couldnt get any solution or code.So that I cant tell you, what I have tried so far. Any help would be appreciated. Thank you... Edit: I have found here that we can use custom layouts for notification.So, is it possible to access textview in custom layout, and use typeface? 回答1: Notifications contain textViews and you can always setTypeface on textViews. 来源: https:/

Android Notification.Builder vs NotificationCompat.Builder [duplicate]

谁说我不能喝 提交于 2019-12-07 16:12:11
问题 This question already has answers here : Why is NotificationCompat needed? (3 answers) Closed 2 years ago . Pretty much all the bits of sample code I see for Android notififactions appear to use NotificationCompat. I have written up my own code using Notification.Builder. It is not clear to me what benefits, if any, there might be in using NotificationCompat.Builder. I hope that someone here might be able to explain the differences. 回答1: You can use things like NotificationCompat.Builder