title: android Illegal state exception at end of activity
body: <p>I have an activity which starts another activity (it's child) upon a button click. This activity accepts some values from text fields and inserts it into a database. Somehwere there is an error and the activity closes saying "Unfortunately, app has closed", but all the values ARE entered into the DB. I have no idea what's going on, please help me. Here is the debug:</p>
  
  <pre><code>Thread [&lt;1&gt; main] (Suspended (exception IllegalStateException)) 
  &lt;VM does not provide monitor information&gt;   
  View$1.onClick(View) line: 3599 
  Button(View).performClick() line: 4204  
  View$PerformClick.run() line: 17355 
  Handler.handleCallback(Message) line: 725   
  ViewRootImpl$ViewRootHandler(Handler).dispatchMessage(Message) line: 92 
  Looper.loop() line: 137 
  ActivityThread.main(String[]) line: 5041    
  Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
  Method.invoke(Object, Object...) line: 511  
  ZygoteInit$MethodAndArgsCaller.run() line: 793  
  ZygoteInit.main(String[]) line: 560 
  NativeStart.main(String[]) line: not available [native method]  
  </code></pre>