Android中调用系统的文件浏览器及自制简单的文件浏览器

2019-12-10 18:13:47于丽

    
自制文件浏览器:
这里只加一些简单的图形:

Android,文件浏览器

来看代码:

<LinearLayout xmlns:android="http://www.easck.com/apk/res/android" 
  xmlns:tools="http://www.easck.com/tools" 
  android:layout_width="match_parent" 
  android:layout_height="wrap_content" 
  android:orientation="vertical" 
  android:layout_gravity="center_horizontal" 
  tools:context=".MainActivity" > 
 
  <TextView 
    android:id="@+id/txt1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" /> 
  <ImageButton  
    android:id="@+id/imageBt1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/home"/> 
 
  <ListView 
    android:id="@+id/listFile" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" > 
  </ListView> 
 
</LinearLayout> 
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://www.easck.com/apk/res/android" 
  android:layout_width="match_parent" 
  android:layout_height="match_parent" 
  android:orientation="horizontal" > 
 
  <ImageView 
    android:id="@+id/images" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" /> 
 
  <TextView 
    android:id="@+id/txtview" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" /> 
 
</LinearLayout>