使用ListView显示Android SD卡中的文件列表
父类布局activity_main.xml,子类布局line.xml(一个文件的单独存放)
运行截图:
程序结构:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:andro
package="com.example.asus.gary03_text">
<!--AndroidManifest.xml获取手机存储卡权限-->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>