0

I'm having a problem with Kitkat. I've an app that was working (in fact it works in android 2.3-4.2) but now behaves strangely in Kitkat. When I call

 db.beginTransaction();
 Intent intent = new Intent(getApplicationContext(),TriggerSelectionPopupActivity.class);
 intent.putExtra("_id", _id);
 startActivityForResult(intent, 0);

when the TriggerSelectionPopupActivity returns the caller activity is stuck (onActivityResult is not called either). This happens also if the call is a normal startActivity while doesn't happen if I don't call the beginTransaction() method on the database.

No error message are generated, BTW, just the ANR situation.

Does anyone have experienced a similar problem?

Update

Ok, I figured out that it was due to the "don't keep activities" option in developer options. When the TriggerSelectionPopupActivity returned couldn't find the caller activity. Thus, it was re-created and db.beginTransaction() was called again causing the deadlock.

dantard
  • 11
  • 1
  • 4
  • I have no idea why you think what you are doing is sensible. This is equivalent to starting a database transaction when responding to one URL in a Web server and not closing it, expecting to commit or roll it back on some subsequent request. – CommonsWare Jan 06 '14 at 15:26
  • I know, it is not clear to me either. I simply figured out that if I didn't use the db.beginTransaction(); it did work. However I just figured out that it was due to the "don't keep activity" option in developer options. – dantard Jan 06 '14 at 15:28

0 Answers0