Do not call Actvity A from Actvity B.Just Call OnBackPressed use the below code to get result from Actvity B
In Activity A
//Activity A calls Activity B
Intent intent = new Intent(getApplicationContext(), HayvanKartiList.class);
intent.putExtra("activityname",BuzagiKayitActivity.class);
intent.putExtra("ciftlikoid", ciflikoid);
startActivityForResult(intent, REQUEST_CODE);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CODE) {
// parse your returned values from data intent here
}
}
In Activity B
@Override
public void onBackPressed() {
getIntent().putExtra("kupeno", selItem.getKupeNo().toString());
getIntent().putExtra("hayvanoid", selItem.getOid().toString());
this.setResult(RESULT_OK, getIntent());
super.onBackPressed();
}
To Call Activity A From Actvity B Call OnBackPressed
private void onItemClick(){
onBackPressed();
}
0
solved How to keep edittexts values after calling another activity than back