Q:

get result using startActivityForResult()

I am trying to open my calculator and value from it then I am done here is my code for my page (where the main point is as it shows how I tried to get result)
TextView.OnClickListener listener = new TextView.OnClickListener()
{
    public void onClick(View v) 
    {
        startActivityForResult(new Intent("com.easyPhys.start.calculator"), 1);
    }
};   

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) 
{
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    if(resultCode==1)
    {
        Toast.makeText(this, "Pass", Toast.LENGTH_LONG).show();
    }
}

this is how I tried to give a result from calculator.java:
mClickListener = new ButtonClickListener();
int idList[] = { R.id.button0, R.id.button1, R.id.button2,
R.id.button3, R.id.button4, R.id.button5, R.id.button6,
R.id.button7, R.id.button8, R.id.button9, R.id.buttonLeftParen,
R.id.buttonRightParen, R.id.buttonPlus, R.id.buttonDone,
R.id.buttonMinus, R.id.buttonDivide, R.id.buttonTimes,
R.id.buttonDecimal, R.id.buttonBackspace, R.id.buttonClear, R.id.buttonPow,   R.id.buttonSin, R.id.buttonCos,R.id.buttonTan,R.id.buttonAcos,R.id.buttonAtan,R.id.buttonAsin,R.id.buttonLog,R.id.buttonLog10,R.id.buttonComma,R.id.buttonToradians,R.id.buttonTodegrees };

       for(int id : idList) {
       View v = findViewById(id);
       v.setOnClickListener(mClickListener);
       }

       private class ButtonClickListener implements OnClickListener {

       @Override
       public void onClick(View v) {
       case R.id.buttonDone:

       if(mMathString.length() > 0);

   Bundle bundle = new Bundle();
   bundle.putString("str", mMathString.toString());

   Intent in = new Intent();
   in.putExtras(bundle);
   setResult(1, in);

new View.OnClickListener() {     
   @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub      
   finish();
  }
   };
    break;

can anyone help me to understand where I went wrong as program does not close and give an answer?

A:

Have you verified that your onClick method is being called? The reason I ask is that you show the code for onClick but you don't show that you set this for the equals button by calling setOnClickListener.

