This is my first foray into Java, so forgive me if this is simple, but I am having difficulty iterating through a list and populating a string array with the list items.
Specifically, I am using Jsoup to parse a url and extract certain elements:
Document doc = Jsoup.connect(content).get();
Elements threads = doc.getElementsByClass("page-link");
for (Element src : threads){
String title = src.text();
String href = src.attr("href");
THREADS[0] = title;
}
THREADS is a string array:
static final String[] THREADS = new String[] {};
I don't seem to be able to iterate through the Elements array and populate THREADS with the title values. Leaving the THREADS[0] index in the above example, successfully pushes the final title value into the string[], as expected. But using a for(i=0;i<25;i++) type of loop around the THREADS[i] = title; statement causes a force close in the Android application.
Any tips would be awesome.