How to get data from a method and put in a ListView?
<p>I have this class:</p>

<pre><code>public class Bookmark extends ArrayList&lt;Bkm&gt; {

    public static Bookmark getBookmark(Context context) {
        Bookmark bookmarks = new Bookmark ();

        String[] titles  = context.getResources().getStringArray(R.array.bookmark_titles);
        String[] urls    = context.getResources().getStringArray(R.array.bookmark_urls);
        TypedArray icons = context.getResources().obtainTypedArray(R.array.bookmark_icons);

        for (int i = 0; i &lt; titles.length; i ++) {
            bookmarks.add(titles[i], urls[i], icons.getDrawable(i));
        }

        return bookmarks;
    }
}
</code></pre>

<p>The class has the "getBookmark" method that returns a "bookmarks" object, it contains the fields "titles", "urls" and "icons". How can I get these fields in my main class? I want to create a ListView with the "titles" items and access the corresponding url in a WebView.</p>

<p>In my main class I have this ListView</p>

<pre><code>ListView lv = (ListView) findViewById(R.id.favoritos_listView);
</code></pre>

<p>I am trying to get the data that way</p>

<pre><code>Context context = getApplicationContext();        
ArrayList&lt;Bookmark&gt; my_array = BookmarkCollection.getTestBookmarks(context);
ArrayAdapter&lt;Bookmark&gt; aa = new ArrayAdapter&lt;Bookmark&gt;(context, R.array.bookmark_titles, android.R.layout.simple_list_item_1, my_array);
ListView lv = (ListView) findViewById(R.id.favoritos_listView);
lv.setAdapter(aa);
</code></pre>

<p>But the ListView does not appears.</p>
