Question: I work for my license project, and one part consist in an android client. All was ok, until I upgraded my phone to Android 4.0.4.

So, I have one AsyncTask. It looks like this:

```
public class TestTask extends AsyncTask<Context, Integer, Long> {

@Override
protected Long doInBackground(Context... params) {
    for (int i = 0; i < 10; i++) {
        System.out.println("nothing-" + i);
        if (i == 5) {
            TestTask2 testTask2 = new TestTask2();
            testTask2.execute(null);
        }
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    return null;
}

```

}

This task wait 5 seconds, than it calls another async task, TestTask2.

```
public class TestTask2 extends AsyncTask<Context, Integer, Long> {

@Override
protected Long doInBackground(Context... params) {
    System.out.println("task 2 in action");
    return null;
}

```

}

In android 4.0.3 or lower, the output is:

> 
> nothing-0 nothing-1 nothing-2 nothing-3 nothing-4 nothing-5
> 
> 
> task 2 in action
> 
> 
> nothing-6 nothing-7 nothing-8 nothing-9
> 
> 
> 

When I upgraded to 4.0.4, the second task doesn't start until the first finished its job.

> 
> nothing-0 nothing-1 nothing-2 nothing-3 nothing-4 nothing-5 nothing-6 nothing-7 nothing-8 nothing-9  
> 
>  task 2 in action
> 
> 
> 

Is there any thread policy in android 4.0.4, or something else? what could be the problem?

Answer: 
As always there are many solutions, however we have a similar requirement in an application where we want one page to send a message to another to be displayed to the user. For example, after updating a setting return to the main page with the message "Setting Updated" at the top. Our solution was to send the message in the url, and then have a javascript that runs on every page load looking for a message in the url. If it's there it's shown to the user, if it's not there, nothing happens. 

In our common pageLoad routine (javascript on every page) we do

```
if (jQuery.query.get('fadeMessage'))
{
    FadeMessage(jQuery.query.get('fadeMessage'));
}

```

And then FadeMessage is defined as:

```
function FadeMessage(message) {
jQuery('#fadeMessage').html(message).animate({ "top": "0" }, 1000).delay(2000).animate({ "top": "-80px" }, 1000);

```

}

The "fadeMessage" div is on every page as:

```
<div id="fadeMessage">
</div>

```

Although as I'm typing this I'm thinking we could just inject that div when it's needed. Hmmm... :-)
You could do this using Javascript/jQuery only by checking for the hash part of the URL on page load: 

`http://mydomain.com/some/path#showcontainer1` 

HTML

```
<div class="container_one" style="display:none;">Content</div>
<div class="container_two" style="display:none;">Other Content</div>

```

JS

```
$(function(){

  switch( window.location.hash ){
    case '#showcontainer1':  //if hash is #showcontainer1
      $('.container_one').fadeIn();   //fadein the container with some class 
      break;
    default:
      $('.container_two').fadeIn()   //else fade container with other class
      break;
  }

});

```