想要弹出系统的邮件界面时,常规做法是直接使用一个intent来启动那个界面。但是在系统里未安装任何邮件客户端软件时,那种做法会抛出异常而引起自己的程序崩溃。解决办法是, 以Intent.createChooser的形式来调用邮件客户端,这样会显示一个选择框,由用户来选择使用哪个客户端来发送邮件,而即使系统没有任何邮件客户端,在此选择界面上也会告之用户。
http://stackoverflow.com/questions/11517563/no-activity-found-to-handle-intent-while-emailing-data
亮点:
Call the StartActivity method in the following way:
startActivity(Intent.createChooser(emailIntent,
"Send Email Using: "));
If System do not find any eamil application, A nice Dialog will be shown:
张柏芝
HxLauncher: Launch Android applications by voice commands