ActivityNotFoundException: No Activity found to handle Intent
代码如下:
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(filePath)), type);
context.startActivity(intent);
异常信息提示如下:
03-20 16:46:48.760: E/AndroidRuntime(30325): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///storage/sdcard0/e-books/Books/book/课堂/PPT/第2章 移动终端.ppt typ=application/vnd.ms-powerpoint flg=0x10000000 }
经过:在有的手机,可以打开ppt文件,在我自己的手机打不开,调试后发现上面的错误信息。
原因:手机没有安装可以打开ppt文件的应用,会出现上面的问题。
解决方法:为了避免有的手机没有安装打开相应文件的应用,应该在startActivity那里做一个try catch,弹出一个toast做提示
ActivityNotFoundException: No Activity found to handle Intent的更多相关文章
- android.content.ActivityNotFoundException: No Activity found to handle Intent { (has extras) }
报错: 初始代码: @OnClick(R.id.include_top_iv_more) public void onViewClicked() { Intent intent_chat_set = ...
- Android开发之bug-No Activity found to handle Intent
android.content.ActivityNotFoundException: No Activity found to handle Intent 做Android开发中,使用隐式intent ...
- DownloadManager 版本更新,出现 No Activity found to handle Intent 的解决办法
项目中,进行版本更新的时候,用的是自己写的下载方案,最近看到了使用系统服务 DownloadManager 进行版本更新,自己也试试. 在下载完成以后,安装更新的时候,出现了一个 crash,抓取的 ...
- Android:使用 DownloadManager 进行版本更新,出现 No Activity found to handle Intent 及解决办法
项目中,进行版本更新的时候,用的是自己写的下载方案,最近看到了使用系统服务 DownloadManager 进行版本更新,自己也试试. 在下载完成以后,安装更新的时候,出现了一个 crash,抓取的 ...
- Activity启动模式 及 Intent Flags 与 栈 的关联分析
http://blog.csdn.net/vipzjyno1/article/details/25463457 Android启动模式Flags栈Task 目录(?)[+] 什么是栈 栈 ...
- 【转】Activity启动模式 及 Intent Flags 与 栈 的关联分析
http://blog.csdn.net/vipzjyno1/article/details/25463457 在学习Android的过程中,Intent是我们最常用Android用于进程内或进 ...
- Android学习之基础知识四-Activity活动3讲(Intent的使用)
主活动名称FirstActivity.java改为了MenuTest.java 一.什么是Intent: 1.Intent是Android程序中各组件之间进行交互的重要方式,不仅可以指明当前组件想要进 ...
- 多个Activity相互调用和Intent
MainActivity.java和OtherActivity.java的相互调用 首先MainActivity.java是Android程序自带的,新建一个类OtherActiviy extends ...
- 06 Activity的启动模式 Intent的七大属性的总结
1.Task以及back stack >Task(任务) 为了完成一个功能 多个Activity的集合, 当你的应用程序启动时 系统会自动创建Task用于管理Activity ...
随机推荐
- Windows下如何使用BOOST C++库 .
Windows下如何使用BOOST C++库 我采用的是VC8.0和boost_1_35_0.自己重新编译boost当然可以,但是我使用了 http://www.boostpro.com/produc ...
- java:I/O 根据用户输入反馈信息
import java.io.*; class userInputIO{ //Java中成员变量有默认初始化,也就是如果不显式设置初始值的话就会被初始化为其类型的默认值(0.false.null等). ...
- windows8.1下安装.NET Framework 3.5
今天安装Arcgis10.2提示需要安装.NET Framework 3.5.校园网的网速,你懂的.所以,在线安装不太现实. 在线安装方法: 如何在 Windows 8 上安装 .NET Framew ...
- P114、面试题17:合并两个排序的链表
题目:输入两个递增排序的链表,合并这两个链表并使新链表中的结点仍然是按照递增顺序的.struct ListNode{ int m_nKey; ListNode* m_p ...
- Move to Another Changelist
Move to Another Changelist 将选中的文件转移到其他的 Change list 中. Change list 是一个重要的概念,这里需要进行重点说明.很多时候,我们开发一个项目 ...
- Yii cookie操作
设置cookie: $cookie = new CHttpCookie('mycookie','this is my cookie'); $cookie->expire = time()+60* ...
- puppet&mcollective客户端安装
一.环境: 1.客户端: fedora 19 2.DnsServer: 192.168.0.160 3.server1.xxx.com(10.8.1.201):运行以下服 ...
- PL/SQL Developer使用技巧
1.PL/SQL Developer记住登陆密码 在使用PL/SQL Developer时,为了工作方便希望PL/SQL Developer记住登录Oracle的用户名和密码: 设置方法:PL/SQL ...
- poj1925Spiderman(dp)
链接 确实是破题 按复杂度估计怎么着也不能按坐标D 啊 网上的代码交上去还TLE 无语了 多次TLE之后终于看到一次WA..好高兴 以横坐标进行DP dp[j] = min(dp[j],dp[2*x ...
- Java [Leetcode 273]Delete Node in a Linked List
题目描述: Write a function to delete a node (except the tail) in a singly linked list, given only access ...