get result using startActivityForResult()
<p>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)</p>

<pre><code>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();
    }
}
</code></pre>

<p>this is how I tried to give a result from calculator.java:</p>

<pre><code>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() &gt; 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;
</code></pre>

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