Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Runtime exception: failure delivering result

In answering this question please take into consideration the fact that I'm an Android newbie.

In my app Activity A explicitly calls Activity B, which has to supply it with some data from the user (i.e. a date). Activity B returns when the user presses the Done button.

But in the case that the user presses the Back button, what I get is a Runtime exception failure delivering result.

Any clue?

like image 272
GionJh Avatar asked May 23 '26 09:05

GionJh


1 Answers

Most likely the problem is that you need to check for a cancelled result in Activity A.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (resultCode == Activity.RESULT_CANCELLED) {
        // Do something
    }
}
like image 69
GrimmRanger Avatar answered May 26 '26 00:05

GrimmRanger