那是因为你的教学大纲对象是空的! 您必须将ValueEventListener赋予您存储在该特定子项中的对象
loadmcafirstsylabus.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { //this retrives the java object you saved in that particular child sl = dataSnapshot.getValue(Syllabus.class); String img = sl.getImg(); //rest of your code }