Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Course Queries Syllabus Queries 2 years ago
Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I am passing an object from MainActivity to GradeListActivity. In GradeListActivity I have a Fragment (which contains a ListView). I am trying to populate this ListView but whenever my app runs, GradListActivity is blank.
MainActivity
GradeListActivity
Fragment
ListView
GradListActivity
I debugged my program to make sure the object is being passed to the GradeListActivity and ListViewfragment (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.
ListViewfragment
My MainActivity.java:
public class MainActivity extends Activity { public GradeCollection gc; RatingBar GradeRatingBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GradeRatingBar = (RatingBar) findViewById(R.id.ratingBar); gc = new GradeCollection(); GradeData gd = new GradeData("Exam", 1, 85, "First Exam"); GradeData gd2 = new GradeData("Homework", 1, 100, "Schedule"); GradeData gd3 = new GradeData("Homework", 2, 100, "Hello goodbye"); GradeData gd4= new GradeData("Quiz", 1, 0, "Syllabus"); GradeData gd5 = new GradeData("Quiz", 2, 80, "Chapter 1"); GradeData gd6 = new GradeData("Quiz", 3, 60, "Chapter 4"); GradeData gd7 = new GradeData("Lab", 1, 100, "Hello yankees"); GradeData gd8 = new GradeData("Lab", 2, 100, "Manifest and Different Screens"); GradeData gd9 = new GradeData("Lab", 3, 100, "Internalization"); GradeData gd10 = new GradeData("Lab", 4, 100, "Layout and Controls"); GradeData gd11 = new GradeData("Lab", 5, 100, "Easy Fragment"); GradeData gd12 = new GradeData( REPLY 0 views 0 likes 0 shares Facebook Twitter Linked In WhatsApp
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);
onCreateView
lv
v
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.
Course Queries 4 Answers
Course Queries 5 Answers
Course Queries 1 Answers
Course Queries 3 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.