I have a number of videos in my sd card in the following location... "sdcard/new folder/**.mp4". Now I want to populate a listview with the names of these videos. The number of videos is going to vary every time. There is no fixed number of videos. So saving the names in the "values" folder isn't gonna do me any good. My code is below...
public class Main extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
and the main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
I don't know how to populate the listview with the names of the videos. Please help.