On 8 May 2010 05:39, blew <[email protected]> wrote:

> You may want to update your intent with the latest app state just
> before the user leaves your application.
> That way your onResume will work with the most up-to-date intent:
> Either the one from updated by your widget or the one updated by your
> app itself.
>
>

Hi,

I don't know if I understood your advice, but I tried some things like
that.

I tried to put new data into the intent (like a "used" flag) and updating
the intent with setIntent(updatedIntent). I also tried to create an useless
new intent and replace the application intent with setIntent(newIntent). But
every time that I go back to application the very first intent is handled
again with its original data and then the dialog is shown.

I tried to put some state into my code too, but how could my application
know the difference between an intent that was sent for the first time and
an intent that is being sent again? It's my main problem.

Thanks,


Esdras Beleza
http://www.esdrasbeleza.com
http://www.makeinstall.com.br


>
> On May 8, 12:25 am, Esdras Beleza <[email protected]> wrote:
> > Hi,
> >
> > I have a widget that talks with an activity from my application. When
> > I click in a button on my widget, it sends an intent to my application
> > main activity, that handles it and shows a dialog.
> >
> > My problem is that if I go to another application, alternate between
> > applications, go to home screen and back -- if my application is not
> > in foreground -- and I go back to her, the old intent that my widget
> > sent to my activity is handled again and suddenly a dialog is shown.
> >
> > The intent is handled using onResume, to handle the cases where the
> > application was just created and when the application is restarted by
> > widget, but also happens when user comes back to it.
> >
> > Does anybody here have any tip that could help me to solve this
> > problem?
> >
> > Thanks in advance,
> >
> > Esdras Beleza
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > For more options, visit this group athttp://
> groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to