Now that I have researched this even more I am rewriting this to make it clearer. If you are looking for more info, there is some available in older edits.
What is happening:
(This refers to an application that has not set any launchMode settings and so is using the defaults)
You launch an app from the Market or from the Installer. This launches the root/main activity of the application with the FLAG_ACTIVITY_NEW_TASK flag and no categories. Right now the applications stack is [ A ]
Then you proceed to the next activity in the application. Now the stack in this task is [ A > B ]
Then you press the home key and then relaunch the same application by pressing it's icon from either the home screen or the app tray.
What is expected at this point is that activity B will show, since that is where you left off. However A is shown and the tasks stack is [ A > B > A ] This second instance of A is launched with the following flags: FLAG_ACTIVITY_NEW_TASK, FLAG_ACTIVITY_RESET_IF_NEEDED, and FLAG_ACTIVITY_BROUGHT_TO_FRONT. It also has the android.intent.category.LAUNCHER category.
At this point, if you hit the back key, it will return you to B, as it was when you left it.
Looking at the documentation it seems as if FLAG_ACTIVITY_BROUGHT_TO_FRONT should only be set for activities that use the singleTask or singleTop launchModes. However, this application has not set any launchModes and is therefore using the default standard launchMode.
I assume this is not suppose to happen in this case?
I should also note, that once it gets into this weird state, then it happens everytime the app is launched from the home screen or app tray. If the task is finished (restarting the phone, force stopping the app, or hitting back all the way through the stack) will fix this issue and will no longer launch it incorrectly. It only happens if you launch the app from the installer or market and then try to launch it from the launcher.
So in summary, why is this happening? Is there a way to prevent it?