call to finish() causes startActivity() AndroidRuntimeException

view full story

http://stackoverflow.com – Sometimes, when I close a particular activity with the finish() method, I get the error: AndroidRuntimeException “Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag” This seems to only happen if I close the activity (by clicking a back button) quickly after it is started. It doesn't happen all of the time however. Here's the activity hierarchy in a nutshell: MainActivity->ListViewActivity->ItemViewActivity The error occurs (periodically) when returning from ItemView. To describe the full chain, I have a button in MainActivity, when (HowTos)