That's my question more or less... I've got a class that extends from Exception
and I need it to be inserted in a parcel.
How can I achieve that?
public class Result implements Parcelable
{
public Result(UserException exception){
this.exception = exception;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
if (exception != null){
// What to do here ant to un-parcel it?
}
}
}
My class:
public class UserException extends Exception
{
string message;
public UserException() {
super();
}
public UserException(String message, Throwable cause)
{
super(message, cause);
this.cause = cause;
this.message = message;
}
}