Back always seems to create a Activity.

When exiting an Activity and returing to the previous one that started it.  It seems the OUYA version of android is always firing the onCreate method instead of coming in at the restart method.   I have my app working as expected on stock Android 4.2.2 and Google TV 3.2 and each of these returns through the restart method of the prior activity.

Is the OUYA pre-maturely killing the prior activity after launching it causing it to have to be recreated?  Anybody else experience this issue?

Comments

  • LususAnimatLususAnimat Posts: 32Member
    As I understand it, the Android OS may destroy any Activity that is invisible to the user (stopped) at any time, requiring it to be recreated if the user accesses it again. Ordinarily, this will only happen when the OS is encountering memory pressure and needs to reclaim resources. The OUYA implementation of Android, however, is supposedly much more aggressive in destroying stopped Activities because the user is not expected to multitask on OUYA.

    Even though you're less likely to see an Activity destroyed before being restarted on standard Android builds, you still shouldn't rely on this behavior on any Android system. Always assume that the Activity beibg destroyed after being stopped is a possibility, and preserve all necessary information accordingly.
  • kingargylekingargyle Posts: 2Member
    Thanks.  Looks like I need to implement the code around onSaveInstanceState and onRestoreInstanceState to make sure that the relevant information that is needed is restored when the activity is killed by the OUYA.
Sign In or Register to comment.