I want to pass a list of objects from one activity from another activity. I have one class SharedBooking Below:
public class SharedBooking {
public int account_id;
public Double betrag;
public Double betrag_effected;
public int taxType;
public int tax;
public String postingText;
}
Code from Calling activity:
public List<SharedBooking> SharedBookingList = new ArrayList<SharedBooking>();
public void goDivision(Context context, Double betrag, List<SharedBooking> bookingList) {
final Intent intent = new Intent(context, Division.class);
intent.putExtra(Constants.BETRAG, betrag);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(intent);
}
COde on called activity:
Bundle extras = getIntent().getExtras();
if (extras != null) {
amount = extras.getDouble(Constants.BETRAG,0);
}
How can I send the list of SharedBooking from one activity and receive that on other activity?
Please suggest me any usable link or sample code.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…