安卓手机如何打开eye文件
发布时间: 2023-02-14 18:35:45
⑴ Android如何修改开机自动启动程序设置
以MIUI系统为例来说明一下修改开机启用应用步骤:
1、打开手机系统中的安全中心应用,选择”权限管理“选项。
⑵ Android 调用其他应用打开文件
java">/**
*打开文件
*@paramfile
*/
privatevoidopenFile(Filefile){
Intentintent=newIntent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//设置intent的Action属性
intent.setAction(Intent.ACTION_VIEW);
//获取文件file的MIME类型
Stringtype=getMIMEType(file);
//设置intent的data和Type属性。
intent.setDataAndType(/*uri*/Uri.fromFile(file),type);
//跳转
startActivity(intent);
}
/**
*根据文件后缀名获得对应的MIME类型。
*@paramfile
*/
privateStringgetMIMEType(Filefile){
Stringtype="*/*";
StringfName=file.getName();
//获取后缀名前的分隔符"."在fName中的位置。
intdotIndex=fName.lastIndexOf(".");
if(dotIndex<0){
returntype;
}
/*获取文件的后缀名*/
Stringend=fName.substring(dotIndex,fName.length()).toLowerCase();
if(end=="")returntype;
//在MIME和文件类型的匹配表中找到对应的MIME类型。
for(inti=0;i<MIME_MapTable.length;i++){//MIME_MapTable??在这里你一定有疑问,这个MIME_MapTable是什么?
if(end.equals(MIME_MapTable[i][0]))
type=MIME_MapTable[i][1];
}
returntype;
}具体的看这篇文章http://tonysun3544.iteye.com/blog/1265884
热点内容