文件管理器android实现,Android开发之简单文件管理器实现方法
易采站長站為您分析Android開發之簡單文件管理器實現方法,簡單實現了Android的文件目錄查看,文件重命名,打開,刪除等功能,需要的朋友可以參考下
本文實例講述了Android開發之簡單文件管理器實現方法。,具體如下:
這里運用Java I/O、ListActivity、Dialog、Bitmap等實現簡單文件管理器,可以查看目錄文件,修改文件名,刪除文件,打開文件。比較簡單,直接看代碼:
先看布局文件:
layout/main.xml
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:id="@android:id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
文件列表布局:
layout/file.xml
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp">
修改文件名對話框布局文件:
layout/rename_dialog.xml
xmlns:android="http://www.easck.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
總結
以上是生活随笔為你收集整理的文件管理器android实现,Android开发之简单文件管理器实现方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: joseph c语言,C语言指针-C语言
- 下一篇: 图片去雾c语言代码,深度学习实现图像去雾