-
Android indexOf搜索文件示例
Android 系统中搜索文件的一个简单例子,功能和Windows搜索文件相似,不过实现上就差别大了:先载入main.xml Layout ,初始化对象:
mKeyword=(EditText)findViewById(R.id.mKeyword);
mButton=(Button)findViewById(R.id.mButton);
mResult=(TextView) findViewById(R.id.mResult);
然后定义一个方法,将mButton添加onClickListener,取得输入的关键字,再创建搜索文件的method:
private String searchFile(String keyword)
{
String result="";
File[] files=new File("/").listFiles();
for( File f : files )
{
if(f.getName().indexOf(keyword)>=0)
{
result+=f.getPath()+"
";
}
}
if(result.equals("")) result="找不到文件!!";
return result;
- 2023-07-23 19:15:03下载
- 积分:1
-
android 创建热点
android 热点创建
- 2015-05-17下载
- 积分:1
-
Android
- 2023-08-06 06:40:03下载
- 积分:1
-
ptr2
类似sina微博的下拉刷新功能实现demo(Similar sina microblogging functionality to achieve the drop-down refresh demo)
- 2011-10-20 10:10:39下载
- 积分:1
-
物联网开关控制程序
DIFI物联,一款简易的物联网开发源代码,适合初学者进行学习和使用
- 2022-02-02 22:20:11下载
- 积分:1
-
Android GetPost 发送GET 发送POST的示例代码
Android GetPost 发送GET 发送POST的示例代码,发送post必须设置以下两行代码:
conn.setDoInput(true);
conn.setDoOutput(true);
- 2022-08-08 03:30:06下载
- 积分:1
-
AndroidTheme
Android的样式和风格案例1-ImageButton按下的弹起的效果
案例2-自定义的Activity的Theme
案例3-Activity背景模糊透明
(Android style in case 1-ImageButton the effect of pressing the up Case 2- Custom Theme Activity in the case of 3-Activity background blur transparent)
- 2011-05-08 08:41:17下载
- 积分:1
-
Android 3D 走马灯
翻译 maninwest@Codeforge 作者:Igor Kushnarev@ Codeproject如何在安卓平台上实现 3D 走马灯准备工作首先决定定义走马灯行为的参数。例如,走马灯中项目的最小数量。如果只有一两个项目不好看,是不是?考虑到性能问题,我们得定义最大项目数量。我们还需要走马灯的最大θ 角度、里面的项目以及当前选择的项目,项目是否会被反射等。让我们在 attrs.xml 文件中定义: 走马灯项目类为了简化走马灯项目,我创建了CarouselImageView:public class CarouselImageView extends ImageView implements Comparable { private int index;
- 2022-04-28 20:52:39下载
- 积分:1
-
基于安卓Android小型仓库管理系统APP的设计与实现(MySQL)(含录像)(毕业论文9000字,安卓APP客户端和JAVA服务端程序代码,MySQL数据库)
基于安卓Android小型仓库管理系统APP的设计与实现(MySQL)(含录像)(毕业论文9000字,安卓APP客户端和JAVA服务端程序代码,MySQL数据库)
- 2019-06-08下载
- 积分:1
-
android 一键锁屏实例源码下载
android 一键锁屏实例源码下载
- 2014-09-02下载
- 积分:1