I am trying to receive data from new Activity to old Activity.
In other words, newer Activity must send intend data to old activity when it finishes.
I've use setResult(resultcode, NewActivity.this.getIntend);
on newer activity and
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(data != null) {
// doing something
}
}
on old activity. Receives intend data from newer activity.
But this code doesn't work. Always getting data is null.
How to send intent data from finishing Activity to parent activity ?
Also when create new Activity, I am using following code:
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setClass(OldActivty.this, NewActivity.class);
startActivityForResult(intent, 0);
I don't understand why always getting null intent data from newer one.
how to fix it ?
Please advice.
Thanks,
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…