I have a main activity where the username is displayed. When user wants to edit the username, it will go to a profile activity with codes:
Intent intent=new Intent(MainActivity.this, ProfileActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("username", username);
startActivity(intent);
After the user edits the username (saved on server), he can press back key to return to the previous (main) activity. However, at this time, the username is not updated as there is no data transferred in.
How can I transfer the updated username when the user is returning from profile activity to main activity?