PowenKo, Android Tutorial,Bundle, change activity and pass data and return result.

[php]
private final int SECONDARY_ACTIVITY_REQUEST_CODE=0;

//create a new intent and specify that it’s target is SecondaryActivity…
Intent intent = new Intent(getApplicationContext(),newpage.class);
//load the intent with a key "myKey" and assign it’s value
//to be whatever has been entered into the text field…
intent.putExtra("title","xxx");
//launch the secondary activity and send the intent along with it
//note that a request code is passed in as well so that when the
//secondary activity returns control to this activity,
//we can identify the source of the request…
startActivityForResult(intent, SECONDARY_ACTIVITY_REQUEST_CODE);

[/php]
[php]

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent){
super.onActivityResult(requestCode, resultCode, intent);
Bundle extras = intent.getExtras();
String t1=extras.getString("returnKey"):

}
[/php]

newpage.class

[php]
Intent intent=this.getIntent();
Bundle bunde = intent.getExtras();
String t_appslink_url=bunde.getString("title");

[/php]

….. do something…..return…..to fish page..
[php]
Intent intent = new Intent();
//add "returnKey" as a key and assign it the value
//in the textbox…
intent.putExtra("returnKey","finish");
//get ready to send the result back to the caller (MainActivity)
//and put our intent into it (RESULT_OK will tell the caller that
//we have successfully accomplished our task..
setResult(RESULT_OK,intent);
//close this Activity…
finish();

[/php]