我有一个名为applicationGlobal的应用程序类,它有许多对象,如字符串,整数。我想在某些时候将它们全部设置为默认值。这是我的应用程序全局类:
public class appliationGlobal extends Application {
private String auth_token = "";
private String userID = "";
private String groupID = "";
private String firstVisit = "";
private String activeSubscription = "";
private int stateSelection = 1;
private int clickUserId = 8;
private String groupType = "";
private String currentLoggedUserId = "";
private String checkIn_Id = "";
private String initial_state = "";
private String finial_state = "";
private String[] userIds = new String[8];
private String checkin_status = "insert";
private ArrayList<String> lstfeeling;
private String userProfile = null;
private boolean[] badgeCheck = new boolean[8];
SharedPreferences pref;
private String messageCounts[] = new String[8];
private String messageprofilecount = "0";
public String getMessageprofilecount() {
return messageprofilecount;
}
public void setMessageprofilecount(String messageprofilecount) {
this.messageprofilecount = messageprofilecount;
}
private Boolean checkcount = false;
public Boolean getCheckcount() {
return checkcount;
}
public void setCheckcount(Boolean checkcount) {
this.checkcount = checkcount;
}
public ArrayList<String> getLstfeeling() {
return lstfeeling;
}
public void setLstfeeling(ArrayList<String> lstfeeling) {
this.lstfeeling = lstfeeling;
}
public String getCheckIn_Id() {
return checkIn_Id;
}
public void setCheckIn_Id(String checkIn_Id) {
this.checkIn_Id = checkIn_Id;
}
public String getInitial_state() {
return initial_state;
}
public void setInitial_state(String initial_state) {
this.initial_state = initial_state;
}
public String getFinial_state() {
return finial_state;
}
public void setFinial_state(String finial_state) {
this.finial_state = finial_state;
}
public String getCheckin_status() {
return checkin_status;
}
public void setCheckin_status(String checkin_status) {
this.checkin_status = checkin_status;
}
public int getStateSelection() {
return stateSelection;
}
public void setStateSelection(int stateSelection) {
this.stateSelection = stateSelection;
}
ArrayList<String> groupNames = new ArrayList<String>();
public String getAuth_token() {
return auth_token;
}
public void setAuth_token(String auth_token) {
this.auth_token = auth_token;
}
public String getUserID() {
return userID;
}
public void setUserID(String userID) {
this.userID = userID;
}
public String getGroupID() {
return groupID;
}
public void setGroupID(String groupID) {
this.groupID = groupID;
}
public String getFirstVisit() {
return firstVisit;
}
public void setFirstVisit(String firstVisit) {
this.firstVisit = firstVisit;
}
public String getActiveSubscription() {
return activeSubscription;
}
public void setActiveSubscription(String activeSubscription) {
this.activeSubscription = activeSubscription;
}
public ArrayList<String> getGroupNames() {
return groupNames;
}
public void setGroupNames(ArrayList<String> groupNames) {
this.groupNames = groupNames;
}
public String getGroupType() {
return groupType;
}
public void setGroupType(String groupType) {
this.groupType = groupType;
}
public String getUserProfile() {
return userProfile;
}
public void setUserProfile(String userProfile) {
this.userProfile = userProfile;
}
public String getCurrentLoggedUserId() {
return currentLoggedUserId;
}
public void setCurrentLoggedUserId(String currentLoggedUserId) {
this.currentLoggedUserId = currentLoggedUserId;
}
public boolean getBadgeCheck(int x) {
return badgeCheck[x];
}
public void setBadgeCheck(int x, boolean badgeC) {
this.badgeCheck[x] = badgeC;
}
public String getUserIds(int x) {
return userIds[x];
}
public void setUserIds(int x, String userI) {
this.userIds[x] = userI;
}
public int getIdNumber(String x) {
for (int trp = 0; trp < 8; trp++) {
if (userIds[trp].equals(x))
return trp;
}
return 0;
}
public String getMessageCounts(int x) {
return messageCounts[x];
}
public void setMessageCounts(int x, String messageC) {
this.messageCounts[x] = messageC;
}
public int getClickUserId() {
return clickUserId;
}
public void setClickUserId(int x) {
this.clickUserId = x;
}
}
是否可以通过一些内置函数将它们全部设置为默认值?