我在一个空对象引用上显示“ int android.view.View.getImportantForAccessibility()”错误。我创建了自己的代码,并收到此错误。该如何解决?
这是我的代码:
databaseHelperCompetenciesDate = new DatabaseHelperCompetenciesDate(getActivity());
studentDateArrayList = new ArrayList<>();
studentDateArrayList = databaseHelperCompetenciesDate.getStudentDate();
final CompetenciesDateStudentAdapter competenciesDateStudentAdapter = new CompetenciesDateStudentAdapter(getActivity(), studentDateArrayList);
lv = rootView.findViewById(R.id.recommendations_list);
lv.setAdapter(competenciesDateStudentAdapter);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
competenciesStudentDate = (CompetenciesStudentDate) competenciesDateStudentAdapter.getItem(i);
LearningRecommendations learningRecommendations = new LearningRecommendations();
Bundle bundle = new Bundle();
bundle.putString("id", competenciesStudentDate.getID());
bundle.putString("studentName", competenciesStudentDate.getStudentName());
bundle.putString("recommendedModules", competenciesStudentDate.getRecommendedModules());
bundle.putString("comments", competenciesStudentDate.getComments());
bundle.putString("date", competenciesStudentDate.getDateAdded());
learningRecommendations.setArguments(bundle);
FragmentManager manager = getFragmentManager();
manager.beginTransaction().replace(R.id.fragment_container, learningRecommendations).commit();
}
});
return rootView;