I have a simple form where a user can add, edit, and delete people from a list. When a user has chosen to edit a person it executes startActivityForResult so it can make th
You want to wrap your Activity in an if statement and check resultCode before accessing the intent's bundle:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
// Add this line:
if (resultCode == RESULT_OK) {
Bundle extras = intent.getExtras();
switch(requestCode) {
case ACTIVITY_CREATE:
break;
case ACTIVITY_EDIT:
break;
}
}
}