This might be an extremely stupid question, but I keep on getting a NullPointer.
In my Android app I've got a class called MyMetadata, and I want to fill a List using objects of this class. So I try to do so as follows:
List<MyMetadata> metadataList;
MyMetadata myMetadata = new MyMetadata("first string", "second string");
Log.i(this, myMetadata.toString());
metadataList.add(myMetadata);
The Log.i() displays a line saying com.mycompany.model.MyMetadata@41af34301, so it does exist. But when I try to add it to the list I get a NullPointerException.
Does anybody know what I'm doing wrong here?