I have a class which is a subclass of ArrayAdpater, and I'm trying to make it parcable.
I keep getting this error
"Error:(21, 36) error: Parceler: Unable to find read/write generator for type android.content.Context for android.content.Context context"
Here is the class:
@org.parceler.Parcel
public class conversation_pager extends ArrayAdapter<String> {
private final ArrayList<String> messages;
private Context context;
@ParcelConstructor
public conversation_pager(Context context) {
super(context, -1);
// Initilize our variables
this.context = context;
this.messages = null;
}
public void addMessage(String user, String message) {
// Calm the linter down about a NUllPointerException.
if (messages == null) {
return;
}
// Add the message.
messages.add("<%s> %s".format(user, message));
notifyDataSetChanged();
}
};
I'm trying to avoid using a static context variable.