我正在从SerchPlayer类创建我的播放器的类对象它生成=“com.SearchPlayer不是封闭类”当我运行我的项目时出错
玩家玩家=新玩家();
import cz.msebera.httpclient.android.BuildConfig;
import java.io.Serializable;
import java.util.ArrayList;
public class SearchPlayer {
public ArrayList<Player> Player;
public class Player implements Serializable {
public static final long serialVersionUID = 1;
public String FirstName;
public String LastName;
public String Role;
public String personid;
public String playerImg;
public Player() {
this.personid = BuildConfig.VERSION_NAME;
this.playerImg = BuildConfig.VERSION_NAME;
this.FirstName = BuildConfig.VERSION_NAME;
this.LastName = BuildConfig.VERSION_NAME;
this.Role = BuildConfig.VERSION_NAME;
}
}
}
答案 0 :(得分:2)
您的内部类不是静态的,它需要一个封闭类的实例来创建一个对象。试试
SearchPlayer x = new SearchPLayer();
SearchPlayer.PLayer y = x.new PLayer();