public void onButtonNoClicked(View view){
  startActivity(new Intent(getApplicationContext(),MainActivity.class));
  setResult(RESULT_CANCELED);
  finish();
}

public void onButtonNoClicked ( View view ) { startActivity ( new Intent ( getApplicationContext ( ) , MainActivity . class ) ) ; setResult ( RESULT_CANCELED ) ; finish ( ) ; }
this method is called the no button in the activity is clicked . it calls the main activity .
