Error while displaying records from external storage to listview
<p>Im having problem while displaying .mp3 files from external storage to the listview. Im getting error with "ArrayAdapter requires a resource ID to be a TextView". All is set but dont know why this is happening. Below is the source code, please help me out!</p>

<p>"Activity_main.xml"</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.testproject.MainActivity" &gt;

    &lt;ListView
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:id="@id/android:list" &gt;

    &lt;/ListView&gt;

    &lt;Button
        android:id="@+id/btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@id/android:list"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="43dp"
        android:layout_marginLeft="20dp"
        android:text="@string/stop" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>"list.xml"</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" &gt;

        &lt;TableRow
            android:id="@+id/tableRow1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" &gt;

            &lt;GridLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" &gt;

                &lt;TextView
                    android:id="@+id/txt1"
                    android:layout_width="309dp"
                    android:text="Large Text"
                    android:textAppearance="?android:attr/textAppearanceLarge" /&gt;

            &lt;/GridLayout&gt;

        &lt;/TableRow&gt;
    &lt;/TableLayout&gt;
</code></pre>

<p>"MainActivity.java"</p>

<pre><code>package com.example.testproject;

import java.io.File;

import java.io.FilenameFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.app.ListActivity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;


class mp3filter implements FilenameFilter{


    public boolean accept(File dir, String filename) {

        return filename.endsWith(".mp3");
    }

}
public class MainActivity extends ListActivity {

    private static final String SD_PATH = new String(Environment.getExternalStorageDirectory().getPath() + "/");
    private List&lt;String&gt; voice = new ArrayList&lt;String&gt;();
    private MediaPlayer mp = new MediaPlayer();

    Button btn;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        updatePlayList();

        btn = (Button) this.findViewById(R.id.btn);

        btn.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                mp.stop();

            }
        });
    }
    protected void onListItemClick(ListView list, View view, int position, long id)
    {
        try{
            mp.reset();
            mp.setDataSource(Environment.getExternalStorageDirectory() + voice.get(position));
            mp.prepare();
            mp.start();

        }catch(IOException e)
        {
            Log.v(getString(R.string.app_name), e.getMessage());
        }
    }

    private void updatePlayList() {

        File home = new File(SD_PATH);
        if(home.listFiles(new mp3filter()).length&gt;0)
        {
            for(File file: home.listFiles(new mp3filter()))
                {
                voice.add(file.getName());
                }
        }
        ArrayAdapter&lt;String&gt; voiceList = new ArrayAdapter&lt;String&gt;(this,R.layout.list,voice);
        setListAdapter(voiceList);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}
</code></pre>