WHY THREAD GOES TO SLEEP FIRST AND SETS TEXT VIEW LATER IN AN ACTIVITY here : >*here is the code eg of result set in android first activity with ui having 3 edit text and 3 buttons or text view i need to set values in 2nd text view to display total marks which is calculated from first 3 edit views and sleep for 10sec in main method without using thread but i am getting op ie after going to sleep 10sec and immediatly showing total text view and navigated to next activity ie mentioned in code so how to wait for 10sec after setting total* 

      EditText etMarkOne,etMarkTwo,etMarkThree;
      TextView tvTMarks,tvTotal,tvGrade;`
      int m1,m2,m3,Tmarks;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      inilizeViewControls();
      eventHandlingonViewControls();

       }

      private void eventHandlingonViewControls()          {tvTotal.setOnClickListener(this);
       }

    private void inilizeViewControls() {
    etMarkOne= (EditText) findViewById(R.id.etMarkOne);
    etMarkTwo= (EditText) findViewById(R.id.etMarkTwo);
    etMarkThree= (EditText) findViewById(R.id.etMarkThree);
    tvGrade= (TextView) findViewById(R.id.tvGrade);
    tvTMarks= (TextView) findViewById(R.id.tvTMarks);
    tvTotal= (TextView) findViewById(R.id.tvTotal);
    }

    @Override
    public void onClick(View v) {
    m1=  Integer.parseInt(etMarkOne.getText().toString());
    m2=  Integer.parseInt(etMarkTwo.getText().toString());
    m3=  Integer.parseInt(etMarkThree.getText().toString());
    Tmarks=m1+m2+m3;
    tvTMarks.setText(""+Tmarks);
    
   
    Thread.sleep(2000);
    Intent i= new Intent(MainActivity.this,ResultActivity.class);
    i.putExtra("Tmarks",Tmarks);
    i.putExtra(" m1", m1);
    i.putExtra(" m2", m2);
    i.putExtra(" m3",m3);
    startActivityForResult(i,1);}
    
    }