I am learning android, so I was practising with a program in which I start a new activity with a button and then what ever text was input by the user in the edittext of the previous activity has to displayed in textview of the new started activity but when I pass the user input to the new activity, it doesn't display anything. What can be the problem here is the code: Lets say this parent activity:
case R.id.Sfr:
Intent data= new Intent(SendData.this, RecieveData.class);
Bundle check = new Bundle();
check.putString("UmerData", cheese);
medt.setText(cheese);
data.putExtras(check);
startActivityForResult(data, 5); // It is used to return data from child activity
break;
The child activity which should show the user input passed to it is:
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.recievedata);
Initialize();
Bundle got = getIntent().getExtras();
rt1.setText(got.getString("UmerData"));
}
Why is this child activity not showing userinput which has been passed to it?