android-notifications

Send notification id to receiver while set alarm

断了今生、忘了曾经 提交于 2019-12-13 05:33:05
问题 I try to set an alarm depending user chocies while setting alarm i want to send that alarm's unique notification id to reciever.java. I want to get data by this id on reciever.java. I have a form with this form users are adding their pills and I'm saving every pill in different xml files for example pill1.xml pill2.xml. That saved pills have alarm and notification when alarm time came for example pill2.xml i will show pill2 datas in notirifacation bar. that code on bottom is how i create

Android notification manager update percentage

对着背影说爱祢 提交于 2019-12-13 05:23:49
问题 I am using Notification Manager for content downloading and show the percent of completed download, but each time i call displaymessage function with new percent it creates new notification. How can i just update the notification without creating new one each time? public void displaymessage(String string) { String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); int icon = R.drawable.icon; CharSequence tickerText =

Managing Android Activity stack: bring specific activity instance to front

戏子无情 提交于 2019-12-13 05:05:00
问题 I have a text message app which has two main activities: TextChatActivity - a conversation. Can have multiple instances for multiple conversations. ConvListActivity - a list of all the activities. In addition, a TextChatActivity of a certain conversation can be opened via a status bar notification. What I want to do is to bring a specific TextChatActivity instance to the front. Let's say I have 2 open conversations ( TextChatActivity ) A and B, and B is on front. Now I got a notification that

getting errors while using Notification.Builder

吃可爱长大的小学妹 提交于 2019-12-13 04:45:00
问题 I am getting errors with these lines while handling notifications for different API levels. This is how i did so far: ... int currentapiVersion = android.os.Build.VERSION.SDK_INT; Notification notification; if (currentapiVersion < android.os.Build.VERSION_CODES.HONEYCOMB){ notification = new Notification(icon, text, time); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, TaskDetails.class), 0); notification.setLatestEventInfo(this, title, text, contentIntent);

how to create multi notification based on a list of localtime

爷,独闯天下 提交于 2019-12-13 04:34:39
问题 I want to create several notification based on a local time list. so first I loop throw the list then I change them to millisecond and send them to the notification. based on the current code it only notify me based on the last time and it only loop throw the rest. public static void main(String[] args) { String q = "01:00:00"; String w = "02:00:00"; String e = "03:00:00"; String r = "04:00:00"; LocalTime qq = LocalTime.parse(q); LocalTime ww = LocalTime.parse(w); LocalTime ee = LocalTime

how to resolve Android gcm notifications duplicate messages

巧了我就是萌 提交于 2019-12-13 04:32:49
问题 Hi am getting duplicate notification from gcm server , how to resolve it public class RegisterActivity{ private GoogleCloudMessaging gcm; Context context; String regId; private static final String REG_ID = "regId"; private static final String APP_VERSION = "appVersion"; static final String TAG = "Register Activity"; private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 9000; private GCMRegistrationCallBack registeredActivity; private Error error; public void registerGCM(Context _context

Custom Notification Center

一个人想着一个人 提交于 2019-12-13 03:46:26
问题 Currently I have a requirement that enables push notifications in the app but we can't use other APIs like google's Firebase. So we have the handle the notification management by ourselves. I have thought of this (its just a draft, sorry if there are some typos or mistakes): public class MyNotificationCenter extends IntentService{ private static final String TAG = MyNotificationCenter.class.getSimpleName(); private Timer GetNotifications; private long INTERVAL_REQUEST = 20000; private boolean

Start main activity from notification fails

穿精又带淫゛_ 提交于 2019-12-13 03:45:36
问题 my application has a service with foreground notification. The service runs even if the main activity closes. I want to restart the main activity if i click the notification. What I did seems to be correct. Changes to AndroidManifest.xml : <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> Setting a pending intent in the notification: Intent activityIntent = new Intent(this, Muzika.class);

Android / Overriding with onResume() function of NotificationListenerService class

寵の児 提交于 2019-12-13 03:23:49
问题 In Android, I have to get read with all of the existing status bar notifications from my mobile app that have not been dismissed but also including ones that are previously posted and not necessarily that new notifications as they come in during every time activity of my own Android app has been resumed forever. Of course, by using getActiveNotifications() function in overridden onCreate() function of NotificationListenerService class, as follows: @Override public void onCreate() { super

Android Notification 'Cannot resolve method 'build()' from ABS Fragment

人盡茶涼 提交于 2019-12-13 01:28:52
问题 I am attempting to show a basic notification from a fragment in an ActionBarSherlock layout. I have been following the tutorial here as well as the one on the Android Developer pages, but I am getting the error 'Cannot resolve method 'build()' on the last line. I have imported android.support.v4.app.NotificationCompat and .app.NotificationManager public void createNotification(){ NotificationManager mNotificationManager = (NotificationManager)getActivity().getSystemService(Context