I would like to pass data between activities. When I use one activity (Details), everything works fine, but when I add a second activity (MapsActivity), the application ignores (Details) and transfers data only to MapsActivity. How can I fix it? Thanks in advance
holder.itemView.setOnClickListener(v -> {
Intent mIntent = new Intent(context, Details.class);
Intent mapIntent= new Intent(context,MapsActivity.class);
mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mapIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mIntent.putExtra("Country_CurrencyCode", pozycja.getCurrencies().get(0).getCode());
mIntent.putExtra("Country_CurrencyName", pozycja.getCurrencies().get(0).getName());
mIntent.putExtra("Country_CurrencySymbol", pozycja.getCurrencies().get(0).getSymbol());
context.startActivity(mIntent);
mapIntent.putExtra("Country_Lat",pozycja.getLatlng().get(0));
mapIntent.putExtra("Country_Lng",pozycja.getLatlng().get(1));
context.startActivity(mapIntent);