tags:

views:

42

answers:

2

this is my code.I used one one popup message while clicking on button for that i used Toast after that i want to move next screen

Button Replybutton = (Button) findViewById(R.id.Reply); Replybutton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) {

           EditText ReplysubjeditText=(EditText)findViewById(R.id.ReplysubjeditText);
           EditText ReplymsgeditText=(EditText)findViewById(R.id.ReplymsgeditText);  
           String temp_string=ReplysubjeditText.getText().toString();

     try 
         {

            ReplysubjeditText.setText("");
            ReplymsgeditText.setText("");


          }
          catch(Exception e)
          {
            Log.v("Add",e.toString());
          }

          Toast.makeText(EmailReply.this, "Sending....",
                    Toast.LENGTH_SHORT).show();


            Intent myNewMail = new Intent(EmailReply.this,EmailForm.class);
            myNewMail.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
            startActivity(myNewMail);


      }
       });
A: 

Are you sure diplaying a Toast is the right choice here? IMO and per your description, you need a modal dialog.

However, to answer your question, one of the ways of adding a delay is by suspending a thread for some time(Thread.sleep). Though, I would advise strictly against it.

Samuh
A: 

Or you can try using the Toast on the OnCreate() of the next activity. This might work out.

zapping