I'm new to Java and I'm currently using Android Studio. I just can't understand why .add isn't working. Subject and Assignments are just custom classes. The issue is that the message "Cannot resolve symbol 'add'" pops up and the whole thing fails. I have imported java.util.ArrayList.
ArrayList<Subject> mSubjects = new ArrayList<Subject>();
Subject cheese = new Subject("Cheese",new Assignment[]{new Assignment("Test 1",1.0f,1.0f,1.0f),new Assignment("Test 2",100f,100f,1.0f)},100f,4.0f);
mSubjects.add(cheese);
mSubjects.add(cheese);
put this method in your onCreate
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With