У меня есть следующий код для создания базового профиля в моем приложении, он содержит объект другого класса, который содержит все данные о производительности пользователя в массивах и различные другие примитивные типы данных.Как мне реализовать интерфейс parcelable в этом классе, чтобы я мог передать объект профиля пользователя различным действиям в моем приложении для чтения или записи?Придется ли мне реализовывать интерфейс parcelable в классе Performance, а также в этом классе Profile?
public class Profile {
private String name;
private String email;
private Performance Progress;
private int seed;
private int LastRevisionQuestion = 0;
private int[] LastQuestionQuizLinear = {0,0,0};
private int[] tempScoreQuizLinear = {0,0,0};
private int[] LastQuestionQuizRandom = {0,0,0};
private int[] tempScoreQuizRandom = {0,0,0};
private int[] LastQuestionTimedQuizLinear = {0,0,0};
private int[] tempScoreTimedQuizLinear = {0,0,0};
private int[] tempTotalTimeTimedQuizLinear = {0,0,0};
private int[] LastQuestionTimedQuizRandom = {0,0,0};
private int[] tempScoreTimedQuizRandom = {0,0,0};
private int[] tempTotalTimeTimedQuizRandom = {0,0,0};
/**
* Default constructor
*/
public Profile(){
this("ProfileName", "ProfileEmail");
}
/**
* Overloaded constructor takes user name and email address as input parameter to create a new user
* @param name
* @param email
*/
public Profile(String name, String email){
this.name = name;
this.email = email;
setProgress(new Performance());
}
}