I don't understand why I'm having this errors and how to solve them, on the following code in mine MainActivity file. I've searched on Google but I can't relate the solutions to mine code. I have also passed -Xlint:unchecked to javac, but can't get any wiser either.
I'm pretty new to Android and Java programming and trying to solve any highlights in mine code.
Thanks in advance.
Unchecked assignment: 'java.util.ArrayList' to 'java.util.ArrayList' less... (Ctrl+F1) Signals places where an unchecked warning is issued by the compiler, for example:
void f(HashMap map) { map.put("key", "value"); } Hint: Pass -Xlint:unchecked to javac to get more details.
Unchecked call to 'ArrayList(Collection)' as a member of raw type 'java.util.ArrayList' less... (Ctrl+F1) Signals places where an unchecked warning is issued by the compiler, for example:
void f(HashMap map) { map.put("key", "value"); } Hint: Pass -Xlint:unchecked to javac to get more details.
private void readItems() {
File filesDir = getFilesDir();
File todoFile = new File(filesDir, "todo.txt");
try {
items = new ArrayList<>(FileUtils.readLines(todoFile));
} catch (IOException e) {
items = new ArrayList<>();
}
}