Show dialog while load
<p>I use the group to show activity in one tab.
A and B Activty are the same group.
A call B such as below code:</p>

<pre><code>Intent intent = new Intent(AActivity.this, BActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);  
Window w = MyGroup.group.getLocalActivityManager().startActivity("BActivity", intent);  
View view = w.getDecorView();  
MyGroup.group.setContentView(view);
</code></pre>

<p>And BActivity is a ListActivity.</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.list);
RL url = new URL(urlstr);
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setConnectTimeout(10000);
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setUseCaches(false);
InputStream is = connection.getInputStream();
//extract information from is, and show in list view
}
</code></pre>

<p>I want to show dialog to show loading.
I already try AsyncTask and Thread Runnable method.
But the error <code>Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@2afe9488 is not valid; is your activity running?</code> shows.
How to solve it?</p>
