Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

Having trouble populating an ListView in a Fragment

Course Queries Syllabus Queries
Max. 2000 characters
Replies

usr_profile.png
Atul Kasana

User

( 4 months ago )


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.

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.

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(
			
        

what's your interest