Sounds like this should not be an AsyncTask, but perhaps an
IntentService instead.

2011/9/23 João Rossa <joao.ro...@gmail.com>:
> Its an indeterminate progressbar the only thing i need is to hide or show
> the animation, nothing else, but i just to reflect there background work
> being done from whatever activity started it, even if the current activity
> was not responsible...
>
> regards,
>
> On Fri, Sep 23, 2011 at 5:01 PM, Mark Murphy <mmur...@commonsware.com>
> wrote:
>>
>> On Fri, Sep 23, 2011 at 10:25 AM, Bluemercury <joao.ro...@gmail.com>
>> wrote:
>> > IS there a way to avoid the static references to the views, but at the
>> > same
>> > time giving the possibility of the tasks to change the visibility of the
>> > progressbar even if the current activity visible is not the one who
>> > laucnhed
>> > the task initially?
>>
>> The activities cannot share a progress bar, period. They each have
>> their own progress bar.
>>
>> When you switch between activities, put the progress value (e.g.,
>> getProgress()) in an extra, so the new activity can set its progress
>> bar to match.
>>
>> When you handle rotation events, pass the progress value via
>> onSaveInstanceState(), or possibly as part of the state you pass
>> (along with your AsyncTask) in onRetainNonConfigurationInstance().
>>
>> --
>> Mark Murphy (a Commons Guy)
>> http://commonsware.com | http://github.com/commonsguy
>> http://commonsware.com/blog | http://twitter.com/commonsguy
>>
>> Warescription: Three Android Books, Plus Updates, One Low Price!
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> 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 android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

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

Reply via email to