yes the detach is called on the activity thread in the
onReatainNonConfigurationInstance method...:
* @Override*
* public Object onRetainNonConfigurationInstance() {*
* if(task!=null)*
* task.detach();*
*
*
* return(task);*
* }*
And here's the method that attachs the activity back to the thread:
/**
* do asynctask for background work
*/
public void doAsyncTask(){
//get task back in case of rotation
task= (QuadrosMobileActivityTask)getLastNonConfigurationInstance();
if(task==null){
task= new QuadrosMobileActivityTask(this);
task.execute();
//add to the set of tasks
QuadrosMobileApplicationContext appliContext=
(QuadrosMobileApplicationContext)getApplicationContext();
appliContext.getAsyncTasks().add(task);
}else{
task.attach(this);
}
}
--
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