我正在尝试插入从我的 SQLite 数据库填充的 GridView,但出现错误
“尝试在空对象引用上调用虚拟方法 'android.view.View android.view.View.findViewById(int)'”
MyAdapter.java类
public class MyAdapter extends BaseAdapter {
Context context;
ArrayList<Players> playerList;
private static LayoutInflater inflater = null;
public MyAdapter(Context context, ArrayList<Players> playerList){
this.context = context;
this.playerList = playerList;
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return playerList.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == …Run Code Online (Sandbox Code Playgroud)