title: I am trying to create two activities with intents but getting the error "exception dispatching finished signal...."
body: <p>If anyone could explain me why I am getting this error, and how to rectify it.</p>
  
  <p>This is the second activity </p>
  
  <pre><code>public class Result_activity extends Activity {
  
    @Override
    public void onCreate(Bundle bundle) {
       super.onCreate(bundle);
  
       setContentView(R.layout.result_activity);
       Bundle extras = getIntent().getExtras();
       String inputString = extras.getString("yourkey");
       TextView view = (TextView) findViewById(R.id.textView1);
       view.setText(inputString);
    }
  
    @Override
    public void finish() {
      Intent intent = new Intent();
      EditText editText= (EditText) findViewById(R.id.result_value);
      String string = editText.getText().toString();
      intent.putExtra("returnkey", string);
      setResult(RESULT_OK, intent);
      super.finish();
    }
  } 
  </code></pre>
  
  <p>This is my main Activity </p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
     // constant to determine which sub-activity returns
     private static final int REQUEST_CODE = 10;
  
  
     @Override
     public void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
     }
  
  
      public void onClick(View view) {
          EditText text = (EditText) findViewById(R.id.editText1);
          String string = text.getText().toString();
          Intent i = new Intent(this, Result_activity.class);
          i.putExtra("yourkey", string);
          startActivityForResult(i, REQUEST_CODE);
      }
  
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
           if (resultCode == RESULT_OK &amp;&amp; requestCode == REQUEST_CODE) {
                if (data.hasExtra("returnkey")) {
                    String result = data.getExtras().getString("returnkey");
                if (result != null &amp;&amp; result.length() &gt; 0) {
                    Toast.makeText(this, result, Toast.LENGTH_SHORT).show();
          }
        }
      }
    }
  }
  </code></pre>