Include null
value checks inside onActivityResult()
.
Check whether Intent data
is null and whether it hasExtra()
before using it.
ie,
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if(data!=null){
// Your code
}
}