Android - I am using intent to communicate between two activities
<p>Android - I am using intent to communicate between two activities. I used putExtra() in the      calling activity and i am using getExtras in the called activity. But the problem is iam not able to set the edit text with the number i retrieved in the intent.  below is my program`    </p>

<p>// Calling activity</p>

<pre><code>package com.example.androidtutorial2;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.text.InputType;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //EDIT TEXT
        final EditText sharedata = (EditText) findViewById ( R.id.editText1 ) ;
        sharedata.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL | InputType.TYPE_NUMBER_FLAG_SIGNED);

        //BUTTON
        Button sendbutton = (Button) findViewById (R.id.button2) ;
        sendbutton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                int edittext_data =                     Integer.valueOf(sharedata.getText().toString());

                Intent sendintent = new Intent(MainActivity.this,second_activity.class);
                sendintent.putExtra("somedata", edittext_data);
                startActivity(sendintent);

            }
        });

//        Button button_to_call_activity = (Button) findViewById(R.id.button1);
//        button_to_call_activity.setOnClickListener(new OnClickListener() {
//          
//          @Override
//          public void onClick(View v) {
//          
//              
//          }
//      });

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }


}


//CALLED ACTIVITY



package com.example.androidtutorial2;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputType;
import android.widget.EditText;

public class second_activity extends Activity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);

        EditText displaymessage = (EditText) findViewById ( R.id.editText1 );

        Intent intent1 = getIntent();
        Bundle bundle1 = intent1.getExtras();
        int integer1 = bundle1.getInt("somedata");

        Integer string1 = integer1;

        displaymessage.setText(integer1);               // HERE IS A RUNTIME ERROR


    }
}
</code></pre>
