I have this button that when clicked saves the details entered in my textfields to Google App Engine, right after the call to that onClickListener, i have an intent that starts a new activity, which displays the details I just entered. Here is the code for this:
submitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(v.getId() == R.id.userDetailsCaptureButton) {
new EndpointsTask().execute(getApplicationContext());
}
startActivity(userProfileDisplayIntent);
}
});
Now i want to be able to wait for a couple of seconds before making a call to startActivity
after new EnpointsTask().execute(getApplicationContext)
has been called. I read that using Thread.sleep
causes the UI to freeze and as such isn't best suited for this. What other options are there?