In view_profile, use startActivityForResult to start edit_profile activity.
In edit_profile, handle the back button event to update the content:
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch ( item.getItemId() )
{
case android.R.id.home:
{
// update the content
this.getIntent().putExtra( "CONTENT_PARCELABLE", (Parcelable)content_data );
this.getIntent().putExtra( "CONTENT_STRING", (String)string_content_data );
setResult( RESULT_OK, this.getIntent() );
finish();
return true;
}
}
}
...
in view_profile, get the updated result from data
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
boolean have_changes = false;
if ( requestCode == REQUEST_RECORD_EDIT )
{
if ( resultCode == RESULT_OK )
{
// update the content from data
updated_content = data.getParcelableExtra("CONTENT_PARCELABLE");
updated_string_content = data.getStringExtra("CONTENT_STRING");
}
}
}