android错误No Activity found to handle Intent
来源:互联网 发布:linux 脚本 关闭程序 编辑:程序博客网 时间:2024/05/29 18:05
今天在做安装APK时遇到 一个坑,先看看我自己的代码、
File tempFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+ "/weicon.apk");try{Intent intent = new Intent();intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//设置intent的Action属性intent.setAction(Intent.ACTION_VIEW);//获取文件file的MIME类型String type = getMIMEType(file);//设置intent的data和Type属性。intent.setDataAndType(/*uri*/Uri.fromFile(file), type);/跳转ctx.startActivity(intent); }catch(Exception e){}
这样运行一直报 No Activity found to handle Intent错误,在签名后安装进提示说"解析包时出现问题",就是打不开这个apk
自己尝试方法:
1、打开同一个目录下.txt文件,他妈居然轻松打开,可就是我这个不行
2、尝试的方法很多,忘记了,就不写
看看网友们的说法:
1、手机上没有装打开apk的这个软件,但是我直接点击apk可以打开啊!所以这个方法是不对的。
2、有的说是apk下载不完全,但感觉不这个问题
再看解决方法(会把人气死):注意看文件路径
tempFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+ "/MyDownLoad/weicon.apk");
这样就可以了
到底是什么原因了,希望有高手指点一下
阅读全文
0 0
- android错误No Activity found to handle Intent
- 【Android】 No Activity found to handle Intent.
- Android studio出现错误:android.content.ActivityNotFoundException No Activity found to handle Intent { a
- android.content.ActivityNotFoundException: No Activity found to handle Intent
- android.content.ActivityNotFoundException: No Activity found to handle Intent
- android.content.ActivityNotFoundException: No Activity found to handle Intent
- Android关于No Activity found to handle Intent的问题
- android.content.ActivityNotFoundException: No Activity found to handle Intent
- android.content.ActivityNotFoundException: No Activity found to handle Intent
- android.content.ActivityNotFoundException: No Activity found to handle Intent
- android.content.ActivityNotFoundException: No Activity found to handle Intent
- android.content.ActivityNotFoundException: No Activity found to handle Intent
- android.content.ActivityNotFoundException: No Activity found to handle Intent {
- android.content.ActivityNotFoundException: No Activity found to handle Intent
- android.content.ActivityNotFoundException: No Activity found to handle Intent 的错误
- Android 6.0.1选取本地图片操作时报No Activity found to handle intent错误
- ActivityNotFoundException: No Activity found to handle Intent
- No Activity found to handle Intent
- JAVA POI 导出excel
- HTTP请求
- MyBatis的配置
- 为什么1个字节(Byte)等8位(Bit)?
- 内存溢出:java.lang.OutOfMemoryError: PermGen space
- android错误No Activity found to handle Intent
- python小程序-0002
- redis入门指南中命令总结
- [Android6.0][RK3399] PCIe 接口 4G模块 EC20 调试记录
- leetcode 383. Ransom Note
- 【Java并发】Java内存模型和线程安全
- hql语句:单表查询
- Oracle 大小写区分的处理
- python基础