文件管理器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"

/>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值