0

(first-timer here, so apologies for protocol errors...)

I have an app where the user can edit an item, then click on an icon to have the edits saved. Now, I would like to have the edits saved when the "back" button is pressed.

I tried using onBackPressed, but that didn't help.

Some gory details... When the icon is clicked, it triggers onOptionsItemSelected, where i have inserted code that loads the user's changes into an intent (can SOMEONE please tell me how the Android people chose to name it "intent"?), and then I have

return true;

The main then gets the intent in onActivityResult and finishes the processing.

onBackPressed fills up the intent, but returns "void", and when the main gets control, the intent it receives is "null".

Anyone know how I can get the back button to get the intent to the main?

Thanks

  • Does this answer your question? [How to handle "Up" button?](https://stackoverflow.com/questions/8887390/how-to-handle-up-button) – Ryan M Jan 28 '20 at 01:37
  • Welcome to StackOverflow! Always ask a question with some code that you have done or post error which you are getting. – Pratik Butani Jan 28 '20 at 05:02

0 Answers0