when i press my login button there is a webservice call , at the time of web service call i have to display a progress dialog, and after receiving webservice return an intent to next page… but it always diplays a blank page when intent is called also progress dialog is not showing
if(Utility.isNetworkAvailable(currActivity)){
// Utility.showProgressDialog(currActivity);
new Thread() {
@Override
public void run() {
currActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(Login.this, Listviewer.class);
startActivity(intent);
tempSplashTread = new Thread() { // Thread for showing wait cursor
@Override
public void run() {
currActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
myProgressDialog = new ProgressDialog(InfraSignPdfList.this);
myProgressDialog.setMessage("Loading... ");
myProgressDialog.show();
}
});
}
};
tempSplashTread.start();
finish();
}
});
}
}.start();
}else {
Utility.noNetworkDialog(currActivity);
}
It’s a bad idea to put a progress dialog between launching apps. You need to implement the progress dialog in the one that does the download and then display the next Activity after the downloaded data has been passed to the new activity.
Follow below steps:
1.After Login Button start server call to get data from server till then display progressDialog on current activity.
2.After the data has been downloaded start the next Activity by passing the necessary data to it.