I have this class that I use to configure the Usb connection with a external device. It works ok on my activity android, but I would like to pass it to another activity, but I'm not able to do that. I'm trying to serialize the class to pass to another activity but when I call startactivity the other activity comes a exception.
This is when I call the activity:
Intent lights = new Intent(this, Screen2Activity.class);
lights.putExtra("usb", usb);
startActivity(lights);
The exception is: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.example.vcontrol.Usb)
This is my class:
//-----------------------------------------------------------
//
// Class that configures and communicates with the Usb Port
//
//-----------------------------------------------------------
public class Usb implements Serializable {
//USB Parameters and Controls
private UsbManager usbManager = null;
private UsbDeviceConnection conn = null;
private UsbDevice device = null;
private UsbInterface usbIf = null;
private UsbEndpoint epIN = null;
private UsbEndpoint epOUT = null;
...
Somebody can help me?