android - PendingIntents won't fire after attempting to add 2nd Home screen widget -


I have a widget that sets many pending candidates is. As long as there is only one widget on my home screen, all the widgets are working just fine.

For that time I decided that I was going to restrict the user to one of my home screens widget. If someone is already in use, then ConfigureActivity tells the user a warning dialog box that they can not add a second and then setResult (RESULT_CANCELED, null ). and then finish ().

It works just fine and keeps the user from being able to setup any Home Screen Widget, but that will not be the highest pending anticipated fire The logic tells me "pending intention can not be sent:"

Each pending entries are set to start a service that is used to update the widget If i do electricity The cast and I'd reset it, it does just fine works fine, as long as I do not try to add another widget. At this point it is a little confused for me. Someone has any idea as to why to start adding another widget, but by completing this will my previous pending entries be canceled?

Set up the related cases, pending entries where with FLAG_CANCEL_CURRENT . / P>

The code used to set up my intent and pending entries .

  intentDialog = new intent (getBaseContext (), ScheduleActionsActivity.class); IntentDialog.putExtra ("Action", ACTION_ENTER_SCHEDULE); IntentDialog.setAction ("abc.hwRowOne"); IntentDialog.putExtra ("schedule", sch.getId ()); IntentDialog.putExtra ("Scheduling", sch.getDescription ()); Pending pending Intended Disease 1 = Pending.intactivity (getBaseContext (), 0, IntantDLog, PendingInstant.flag_ncllnnranite); Views.setOnClickPendingIntent (R.id.hwRowOne, Pending Indiatrics1);   

line where intentDialog.setAction () change is unique to each line of the widget, so I thought that my pending unique was also creating. / P>

I had seen this reply last night after posting my question, but I am not sure where / how it works and where I keep it in my area. It appears to set a unique data for each intent, but I think my .setAction () was doing

then answering your question For, no, I am not using App widget ID in my entries, do I have to pass it as putExtra () , then intDDlog ?

The answer to this question solved my issues:

I do not know Why does setData (uri) add work, but he has allowed more than one widget on the home screen and pending candidates are unique and firing as I expect them from I do

On the secure side, I am adding appWidgetId to intent and if I decide, then it may be required later from one device To allow more widgets.

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -