I have actions A, B, and C in my application and they flow in that order. If I implement the Up button in C, I want it to return to B. The encoding of the code generated by Eclipse is:
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: // This ID represents the Home or Up button. In the case of this // activity, the Up button is shown. Use NavUtils to allow users // to navigate up one level in the application structure. For // more details, see the Navigation pattern on Android Design: // // http://developer.android.com/design/patterns/navigation.html#up-vs-back // NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); }
However, B expects additional functions to be transferred from A in its onCreate method. The connection between B and C is that C allows the user to set some parameters that affect the display of B. Currently, I am saving changes to C in onPause (). Should I end () C when the user presses Up instead of calling navigateUpFromSameTask (this)?
ashishduh
source share