List Filenames With Extension

Description:
This example will show how list file names with specified extension in android.
Algorithm:

  1. Create a new project by File-> New -> Android Project name it ListFilenamesWithExtension.
  2. There must be some files on sdcard to show on list.
  3. Run for output.

Steps:

  1. Create a project named ListFilenamesWithExtension and set the information as stated in the image.Build Target: Android 4.2
    Application Name: ListFilenamesWithExtension
    Package Name: com.example.ListFilenamesWithExtension
    Activity Name: ListFilenamesWithExtensionActivity

  1. Open ListFilenamesWithExtensionActivity.java file and write following code there: 
     
  2. Compile and build the project.

Output

Leave a Comment: