Wednesday 15 January 2014

android - Navigating Up to an activity that expects extras -


There are actions in A, B, and C in my app and they flow in that order. If I implement the up button in C, then I want to return it to B. The code stub which is generated by eclipse is:

  @Override Public Boolean ONOPITS selected (menu items) {switch (item .getItemId ()) {case android.r.id.home: // This ID represents Home or Top button. In case of this // activity, the above button is shown. Use Navutils to allow users to navigate a level in the / application structure. // For more details, see navigation patterns on Android design: http://developer.android.com/design/patterns/navigation.html#up-vs-back // NavUtils.navigateUpFromSameTask (this); Back true; } Return Super.Options item selected (item); }   

However, B is expected to pass Extra to A on its on-cut method. The relation between B and C is that C allows the user to set some settings that displays B. I am currently saving changes in C. Should I want (?) When pressing a user to call the Navigate Upframemitted Task (this)?

If you are going back from C again your activity will To create again, if you use standard launch mode, OnSaveInstanceState will be

Announce the launch mode of your activity B such as:

  Android: launchMode = " SingleTop "  

In your AndroidManifest.xml, see if you want to get back to your activity and one.

No comments:

Post a Comment