android - Why activity result code is diffrent then I expected -


I have 2 activities In child activity, I have put something like this (on):

 < Code> if (finishing ()) {intent = new intent (); Intent.putExtra (SOME_DATA, value); SetResult (RESULT_OK, intent); Logs. I ("test", "result set to RESULT_OK"); }  

In the parent activity, I check the result code when child activity is destroyed, and that is what I have seen:

  1. If I Some actions destroy child activity (in some circumstances I call phenol), then result code RESULT_OK
  2. But when I delete the return key by pressing (I only work in the emulator Then its ESC) that kills the activity, then the affair As a result, parents are taught in activity on the Result method equals 0 (RESULT_CANCELD).

In each case the "test" log is the same.

Most likely that is destroying your activity, after the result resets the result is done. To stop is called RESULT_CANCELED. It makes sense, because the activity not ended up happily

are you always trying to complete by setting the result code for RESULT_OK?


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -