android - BroadCast Services and Notification's in Status Bar -


Edit: Since I get an answer, since then I am going to ask my questions in a different way.

I think by putting an alarm manager due to two problems, which call the broadcasted receiver by its pending instant, the app will be shown first when the app opens. On the other hand, if the app stops, notifications can not be made after calling in main proceedings (or as they are a broadcast, they should be run in any way !!!!) If so, the question is that I Where else can I put it?

I am going to develop a TODO list in my application as a feature. I would like to inform the user, even though the app is not operational, so I am using broad-cast services where the service has been called down through my main activity:

  Public Zero NOtifyMe (ArrayList & lt; String & gt; mArrayList) {Alarm Manager AlarmMong = (Alarm Manager) getSystemService (ALARM_SERVICE); // --- Get the current date and time --- Calendar Calendar = Calendar.Just Instance (); Calendar.ed (calendar SECOND, 20); Intent NoteIntent = New Intent (Main Activity.This, Broadcast Class.); NoteIntent.Put StringArrestextra ("Arrayist", MRRLIDIS); // daestra ("cursor", c / * "id", id * /); Pending Expected Pendie = Pending Intent. Tredbordeck (Main Activity. 0, Notification, PendingEnentant.flag_UPDietTART); // // SET alarm alarmmoset. (Alarm Manager. RTC_WAKEUP, Calendar .getTimeInMillis (), Pendi); AlarmMang.Settering (AlarmManager .RTC, System Syrtetime Millis (), Alarm Manager. NTVAWAD, PANDI);  

And here is my Broad Cast service code:

  Receiver on public blank (Reference ARB0, Intent ARG1) {// TODO Automatic Created Stub Arelit & Lt; String & gt; Array = arg1.getStringArrayListExtra ("Arrayist"); Intent = intent (); Intent.setClassName ("com.Sali.todolist_final", "com.Sali.todolist_final.notifyService"); //intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Intent.putStringArrayListExtra ("ArrayList", array); Arg0.startService (intent); }  

As you can see that I am using array list, because in the case of two upcoming tasks, two notifications are not shown. The more I recorded, the more I recorded it was trying to do it first.

Here is the code in the information:

 for  (int i = 0; i  

Here are two major problems I have: First: it does not show notifications running without any other app: As I have set the appropriate flags by clicking on Notification, It will appear again. The third (less important time is the time) I do not like two two notification icons if 2 are upcoming but I like opening the window, the user can see both. I know that I am using the manager. Diagnosis for the body, but in these cases there is no other way for me. She has a solution for this too. If someone can help me, then I recommend it to be really important.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -