Unsupported operation exception when adding or clearing elemetings of list
<p>I have made a function in which i first add contacts one my one.</p>

<pre><code>for (int i = 0; i &lt; jsonArray.length(); i++) {
                    try {
                        JSONObject jsonObject = jsonArray.getJSONObject(i);
                        Contact contact = new Contact();
                        contact.setUserId(jsonObject.getString(ResponseParams.USER_ID));
                        contact.setPhoneNumber(jsonObject.getString(ResponseParams.PHONE_NUMBER));
                        contact.setUserName(jsonObject.getString(ResponseParams.USER_NAME));

                        ((TazligenApp) activity.getApplication()).getTazligenContacts().add(contact);
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
</code></pre>

<p>but on the line:</p>

<p>((TazligenApp) activity.getApplication()).getTazligenContacts().add(contact);</p>

<p>i get unsupported operation exception and this obviously happens when i try to refresh contacts second time , Now i kinda know the reason but i don't know hwo to solve it.
P.S TazligenApp is my application class in android having some variables that i need throughout the cycle</p>