I want this line of code to expect (String, Serializable) but it expects (String, boolean) instead.
intent.putExtra(CheckoutActivity.ZOOZ_INVOICE, invoice);
The error is:
The method putExtra(String, boolean) in the type intent is not applicable for the arguments (String, ZoozInvoice).
I want these arguments to have a (String, Serializable) signature instead of (String, boolean). It should be like this.
CheckoutActivity.ZOOZ_INVOICE = name
invoice = value
I have tried writing it like this:
intent.putExtra(CheckoutActivity.ZOOZ_INVOICE, invoice(CheckoutActivity.ZOOZ_INVOICE, invoice));
This is accepted by Eclipse with no errors, and no compiling errors. However, the code does not work or do what it is supposed to.
In addition, I have tried to changing 'putExtra' to 'getIntExtra' instead and this error appears:
The method getIntExtra(String, int) in the type intent is not applicable for the arguments (String, ZoozInvoice).
I have also tried to change type of 'invoice' to 'boolean'. This results in:
Type mismatch: cannot convert ZoozInvoice to boolean.
And.
Cannotinvoke addItem (String, int, double, int, String, String) on the primitive type boolean.
How can I go about making the Intent expect (String, Serializable) instead of (String, boolean) ?
Code for reference and context.
ZooZInvoice invoice = new ZooZInvoice();
invoice.addItem("item1", 1, 0.5, 0, "1", "good choice!");
invoice.addItem("item2", 1, 3, 0, "2", "additional details for item 2");
invoice.addItem("item3", 1, 2, 0, "3", "additional details for item 3");
invoice.addItem("item4", 1, 8, 0, "4", "additional details for item 4");
invoice.setInvoiceNumber("5512-FA");
invoice.setInvoiceAdditionalDetails("Power Ups for user 12345");
intent.putExtra(CheckoutActivity.ZOOZ_INVOICE, invoice);
startActivityForResult(intent, ZooZ_Activity_ID);