String to ArrayList
<p>App reads TextEdit value to String and then converts to ArrayList. But before converting it removes spaces between words in TextEdit. So after converting I get ArrayList size only 1. </p>

<p>So my question is how to get the real size. I am using ArrayList because of its swap() function.</p>

<pre><code>outputStream.setText("");
        stream = inputStream.getText().toString().replace(" ", "");
        key = Integer.parseInt(inputKey.getText().toString());

        List&lt;String&gt; arrayList = Arrays.asList(stream);
        int lenght = arrayList.size();
        if (key &lt; lenght)
        {
            outputStream.append(lenght+"\n");
            outputStream.append("OK");
        }
        else {
            outputStream.append(lenght+"\n");
            outputStream.append("Error");
        }

    }
</code></pre>
