Change toolbar menu item action dynamically
<p>I've got this menu item on my toolbar, it's action <code>R.id.action_edit</code> sets all of my activity's edittext's status to enabled, I'm wondering how can I do to make that, when clicked, this button changes his action to the second action in the same menu.xml file, <code>R.id.action_save</code>, which updates the fields values into the database, so when clicked again, it would save the data.</p>

<p>Or if there is a way to set the first menuItem visibility to false and the second menuItem to visible when the first one is clicked.</p>