Can anyone help me how to put a progress dialog that loads for 5 seconds and shows a fast after? Here’s the code:
btnSend.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
String phoneNo = editTextRecipient.getText().toString();
String message = editTextNewMessage.getText().toString();
setResult(RESULT_OK);
saveState(phoneNo, message);
final Toast toast = Toast.makeText(getBaseContext(),
"Your message " + "\"" + message + "\"" + " is sent to " +"\""+ phoneNo+"\"",
Toast.LENGTH_SHORT);
toast.show();
Intent setIntent = new Intent(Edit_Message.this, Main.class);
startActivity(setIntent);
}
});
}
I want to put a 5 second progress dialog and a tots that prompts that the message has been sent. Can anyone help me?
Please try this