In your fragment's onCreateView, you're reinflating the layout and returning new view. This new view doesn't have any idea about lv.
Solution:
Return v instead of inflater.inflate(R.layout.list_view_fragment, container, false);
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
manpreet
Best Answer
3 years ago
I am passing an object from
MainActivitytoGradeListActivity. InGradeListActivityI have aFragment(which contains aListView). I am trying to populate thisListViewbut whenever my app runs,GradListActivityis blank.I debugged my program to make sure the object is being passed to the
GradeListActivityandListViewfragment(the fragment class), and it is indeed being passed in. I think i might be not populating the list in the correct place, but any help or guidance will be much appreciated.My MainActivity.java: