Got hit by an UnsupportedOperationException
<p>I have the following code:</p>

<pre><code>    private static ArrayAdapter&lt;String&gt; adapter;
    private static List&lt;Chapter&gt; chapters;

    public void update(Book book) {
        adapter.clear();
        if (chapters != null) {
            chapters.clear();
        }
        chapters = DataBaseConnector.getChaptersFromBook(book.getID());
        for (Chapter chapter : chapters) {
            adapter.add(chapter.getTitle());
        }
        header.setText(book.getAbbreviation());
        subHeader.setText(book.getName() + " (" + book.getNumber() + ")");
        subHeader.setVisibility(View.VISIBLE);
    }
</code></pre>

<p>If I call the method <code>update(Book book)</code> and the variable <code>chapters</code> is not <code>null</code>, I get hit by an <code>UnsupportedOperationException</code> in the line <code>chapters.clear()</code>. Any hints how to solve the problem?</p>
