Skip to content Skip to sidebar Skip to footer

Android: Failure Delivering Result ResultInfo

I have an Activity A in TabHost, A startActivityForResult(B) then B startActivityForResult(C). The problem I meet is that: In C when I setResult(RESULT_OK, intent), occur java.la

Solution 1:

In C I putExtra 2 string (resultDate and time), but I miss the point that resultDate may not be initialized when it is be put into intent. So I got the Error: java.lang.NullPointerException.


Solution 2:

It looks like your Activity B is getting destroyed before C returns. One thing you can check is the "Dev Tools" app (It's among the app icons on most emulators and devices and in Settings on Ice Cream Sandwich labeled as "Developer Options") to make sure that the "Don't keep activities" option is not checked.

One thing you can do to verify that B is getting destroyed is to put a Log statement in Activity B's onCreate method. Then, when Activity C is launched from B, exit C by pushing the hardware Back button. This will destroy C (provided you haven't overridden the Back button), but it will not call B's onCreate unless B has been destroyed.


Post a Comment for "Android: Failure Delivering Result ResultInfo"