Adding an Object to StringBuilder
<p>I'm pretty new to Android development, and what I'm trying to do is display the contents of an <code>ArrayList</code> in a <code>TextView</code>.</p>

<p>I've been attempting to convert the <code>ArrayList</code> into an <code>Array</code>, and then append each item to a <code>StringBuilder</code>. However, the <code>StringBuilder</code> doesn't appear to allow me to append an <code>Object</code> from the <code>Array</code>. Can anyone tell me why, or in fact provide a better solution?</p>

<pre class="lang-java prettyprint-override"><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    ArrayList&lt;String&gt; temp = new ArrayList&lt;String&gt;();
    temp = data.getStringArrayListExtra("intentReturn");
    Object obj[] = temp.toArray();
    for(int i = 0; i &lt; obj.length; i++){
        sBuilder.append((String)obj[i]); //This is the line which crashes the app
        if(i &lt; obj.length - 1){
            sBuilder.append(", ");
        }
    }
    tvResult.setText(sBuilder.toString());
}
</code></pre>

<p>Many thanks in advance.</p>
