我想在我的 MainActivity 中创建一个对象,但我想全局访问它,所以假设我有这个类
public class User {
private String description;
private String display_name;
private String email;
private String followers;
private String following;
private String posts;
private String profile_photo;
private String user_id;
private String username;
public User(){}
public User(String description, String display_name, String email, String followers, String following, String posts, String profile_photo, String user_id, String username) {
this.description = description;
this.display_name = display_name;
this.email = email;
this.followers = followers;
this.following = following;
this.posts = posts;
this.profile_photo = profile_photo;
this.user_id = user_id;
this.username = username;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getDisplay_name() {
return display_name;
}
public void setDisplay_name(String display_name) {
this.display_name = display_name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFollowers() {
return followers;
}
public void setFollowers(String followers) {
this.followers = followers;
}
public String getFollowing() {
return following;
}
public void setFollowing(String following) {
this.following = following;
}
public String getPosts() {
return posts;
}
public void setPosts(String posts) {
this.posts = posts;
}
public String getProfile_photo() {
return profile_photo;
}
public void setProfile_photo(String profile_photo) {
this.profile_photo = profile_photo;
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
'}';
}
}
守着一只汪
相关分类