Re: [android-developers] Re: Async Task, rotation and indeterminate progressbar in custom header.

2011-09-23 Thread João Rossa
Ok ProgressBarThread is already a static inner class, so what you're telling is to change the instance reference to static too: private ProgressBarThread task=null; to private static ProgressBarThread task=null; But now how i tell the task initiated by activity A to attach to the current

Re: [android-developers] Re: Async Task, rotation and indeterminate progressbar in custom header.

2011-09-23 Thread João Rossa
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

Re: [android-developers] Re: Async Task, rotation and indeterminate progressbar in custom header.

2011-09-23 Thread João Rossa
. regards, 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

Re: [android-developers] Re: Async Task, rotation and indeterminate progressbar in custom header.

2011-09-23 Thread João Rossa
. 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

Re: [android-developers] Re: Async Task, rotation and indeterminate progressbar in custom header.

2011-09-23 Thread João Rossa
The use case is that the user should always see the loading progressbar if there's any background work being done in whatever activity the user is and if the task was launched from another activity. I tried putting a reference in the application class to the progressbar and then refresh it in the

Re: [android-developers] Re: Async Task, rotation and indeterminate progressbar in custom header.

2011-09-29 Thread João Rossa
the activity is restarted. 2. Don't stop the task on rotation but detach from it, retain its instance (onRetainNonConfigurationInstance), and reattach to it when the new activity is created. (A generalized version of Mark's async task can be helpful here.) Joe On Sep 23, 6:29 pm, João

Re: [android-developers] runOnUIThread method in doInBackground of Async Task...

2011-10-03 Thread João Rossa
Well when i rotate, either while the thread is started or after the screen data is refreshed it goes back to the fields having not been filled. but the thread does run because if i dont rotate the UI views are filled with the content i fetch from the server. regards, On Mon, Oct 3, 2011 at 10:30

Re: [android-developers] runOnUIThread method in doInBackground of Async Task...

2011-10-03 Thread João Rossa
that if i used the runOnUiThread in the doItInBackground method of async task it would still show the filled ui views. regards, 2011/10/4 João Rossa joao.ro...@gmail.com Well when i rotate, either while the thread is started or after the screen data is refreshed it goes back to the fields having

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-03 Thread João Rossa
getLastNonConfigurationInstance(), which would indicate he's keeping the same AsyncTask instance across the application restart, so he wouldn't have to restart the AsyncTask. 2011/10/3 João Rossa joao.ro...@gmail.com Well when i rotate, either while the thread is started or after the screen

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-03 Thread João Rossa
Never mind the name of the async taskits ParentActivityTask. 2011/10/4 João Rossa joao.ro...@gmail.com Actually my async task is not a inner static class, and it still has a explicit reference to the activity that i refresh, *here's the parent activity:* public abstract class

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-04 Thread João Rossa
I posted the code there..there are no static methods, anyway how do i save the activity(as in the views that are filled) either on rotation *while and after *the task is running? regards, On Tue, Oct 4, 2011 at 1:47 PM, TreKing treking...@gmail.com wrote: On Tue, Oct 4, 2011 at 4:14 AM,

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-04 Thread João Rossa
, TreKing treking...@gmail.com wrote: 2011/10/4 João Rossa joao.ro...@gmail.com I posted the code there..there are no static methods, You have *public abstract class ParentActivity extends Activity* Then in your separate AsyncTask class you have: *@Override* * protected String doInBackground

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-04 Thread João Rossa
Also is there a problem refreshing the contents inside the doItinBackground???im using the runOnUIThread to refresh the views inside the updateResultsInUi() regarids 2011/10/5 João Rossa joao.ro...@gmail.com You're right that was a mistake while copying the code to here, its currently like

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-04 Thread João Rossa
Unfortunately it doesnt seem to be working, at least not when i rotate, i must be missing something here...still let me test this here. regards, On Wed, Oct 5, 2011 at 2:13 AM, TreKing treking...@gmail.com wrote: 2011/10/4 João Rossa joao.ro...@gmail.com Also is there a problem refreshing

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-04 Thread João Rossa
, 2011/10/5 João Rossa joao.ro...@gmail.com Unfortunately it doesnt seem to be working, at least not when i rotate, i must be missing something here...still let me test this here. regards, On Wed, Oct 5, 2011 at 2:13 AM, TreKing treking...@gmail.com wrote: 2011/10/4 João Rossa joao.ro

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-04 Thread João Rossa
Im returning the current task state in the onRetainNonConfigurationStance method, but i assume i need to save here the views filler? regards, 2011/10/5 João Rossa joao.ro...@gmail.com Ok ive put a thread sleep inside the doItInBackground and it seems to refresh when i rotate while the task

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-06 Thread João Rossa
onRetainNonConfigurationInstance() { if(task!=null) task.detach(); return(task); } the task is saved, but how do i save filler views state? regards, 2011/10/5 João Rossa joao.ro...@gmail.com Im returning the current task state in the onRetainNonConfigurationStance method, but i assume i need to save here

Re: [android-developers] AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-11-20 Thread João Rossa
Thanks guys. The idea was to call a unique class whenever an activity had the need to launch tasks, but since i have parent activity where all the activities extend from, they would call the async task and each one would have a method that would used in the doinbackground method of said async

Re: [android-developers] AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-11-20 Thread João Rossa
was attached., Logger.INFO); return null;} } and the detach method would change to: void *detach*() { synchronized(this) { this.activity = null } } Still i need to study this morethanks the same to both regards, 2011/11/20 João Rossa joao.ro...@gmail.com Thanks guys. The idea

Re: [android-developers] AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-11-20 Thread João Rossa
Hi Streets, yeah currently im using the logic to run in the background thread out of the activity, but i was yet to try this approach, but it seems that its unanimously not the best option to take... I was considering for the sake of creating less classes, in this case im extending the async task

Re: [android-developers] getLastNonConfigurationInstace returns null if task is launched from a Spinner OnItemSelectedListener

2011-12-21 Thread João Rossa
So basically you can not use the combination of onRetainNonConfigurationInstance()/ getLastNonConfigurationInstance () with the task inside the spinner listenerbecause i wanted to aunch tasks according to the option selected of the spinner 2011/12/21 Kostya Vasilyev kmans...@gmail.com

Re: [android-developers] getLastNonConfigurationInstace returns null if task is launched from a Spinner OnItemSelectedListener

2011-12-21 Thread João Rossa
, by calling getLast... *inside onCreate*. 22 декабря 2011 г. 2:19 пользователь João Rossa joao.ro...@gmail.com написал: So basically you can not use the combination of onRetainNonConfigurationInstance()/ getLastNonConfigurationInstance () with the task inside the spinner listenerbecause i

Re: [android-developers] getLastNonConfigurationInstace returns null if task is launched from a Spinner OnItemSelectedListener

2011-12-21 Thread João Rossa
or wait for an existing one to complete. 22.12.2011 3:18 пользователь João Rossa joao.ro...@gmail.com написал: But if i want to launch a task based on the spinner value how do you that without calling the task in the itemlistener? regards, On Wed, Dec 21, 2011 at 10:34 PM, Kostya Vasilyev kmans

Re: [android-developers] getLastNonConfigurationInstace returns null if task is launched from a Spinner OnItemSelectedListener

2011-12-21 Thread João Rossa
, etc.) I'd then carry this entire data structure across configuration changes, making sure to get it in onCreate. 22.12.2011 3:35 пользователь João Rossa joao.ro...@gmail.com написал: Ok, so if you had a spinner where each option would be used as a parameter to an async task but you didnt

Re: [android-developers] Problem refreshing a fragment edittext view from a dialogFragment after rotation

2012-06-10 Thread João Rossa
Hi! Sorry for the late reply, so i created call backs, the DialogFragment receives an interface type that the fragment that calls the dialog must implement, this works well if setRetainInstance is set to true, but what if i dont want to use this property? regards, On Thu, Jun 7, 2012 at 9:06 AM,