I’ve got an android logging into my web service asynchronously, but when the task is complete, and I switch to the next activity, there is a stutter. This is annoying as there is a progress bar (in circle mode) on my activity and it pauses, restarts and then the activity is closed. This doesn’t look all too good.
Here is the code:
//Create the new intent.
Intent i = new Intent();
//Set the intent to open the pin entry screen
i.setClassName("com.visualdenim.passpad", "com.visualdenim.passpad.Pin");
Bundle bun = new Bundle();
//Set the data to go in the bundle
bun.putString("login_info", args[0]);
//Put the extras into the bundle
i.putExtras(bun);
//Start the credentials list activity
startActivity(i);
//Set the pretty animation
overridePendingTransition(R.anim.slide_in, R.anim.slide_out);
//Close this activity (so the user can't access the login screen once they are logged in)
finish();
I’m wondering; does all this need to excecute on the UI thread, Is there any way of speeding all that up, or can I stop the progress bar spinning to avoid it starting again?
Thanks, I will tick the right answer!
I got around the problem by fading the progress bar out, and then starting the new activity. This way, the user doesn’t see the stutter on the progress bar and so the transition appears smooth.