make phone call, browse web, send email
2012-04-10 18:24
260 查看
// make phone call
try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:1850363744")); startActivity(callIntent); } catch (ActivityNotFoundException e) { Log.e("Dialing FAILED", "Call failed", e); } try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:+448450730099")); startActivity(callIntent); } catch (ActivityNotFoundException e) { Log.e("Dialing FAILED", "Call failed", e); }
// browse web try { Intent webIntent = new Intent(Intent.ACTION_VIEW); webIntent.setData(Uri.parse("http://www.energia.ie")); startActivity(webIntent); } catch (ActivityNotFoundException e) { Log.e("Browsing FAILED", "Browser failed", e); } // send mail try { Intent emailIntent = new Intent(Intent.ACTION_SENDTO); //Intent intent = new Intent(Intent.ACTION_SENDTO); // it's not ACTION_SEND emailIntent.setType("text/plain"); emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Contact Energia - Smart App"); emailIntent.putExtra(Intent.EXTRA_TEXT, ""); emailIntent.setData(Uri.parse("mailto:customer.service@energia.ie")); // or just "mailto:" for blank emailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // this will make such that when user returns to your app, your app is displayed, instead of the email app. startActivity(emailIntent); } catch (ActivityNotFoundException e) { Log.e("Dialing FAILED", "Call failed", e); }
相关文章推荐
- android - How to make a phone call from webview
- Using UTL_DBWS to Make a Database 11g Callout to a Document Style Web Service
- 网络之Call Phone、Web、SMS、Email
- Using UTL_DBWS to Make a Database 11g Callout to a Document Style Web Service
- Using UTL_DBWS to Make a Database 11g Callout to a Document Style Web Service
- Using UTL_DBWS to Make a Database 11g Callout to a Document Style Web Service
- How to make a call in Windows Phone 7 application
- IOS 程序内调用本地打电话功能-make a phone call
- Android -- make a phone call using Intent--使用意图拨打电话
- [MS Smartphone]Make phone call using native c code
- IOS 程序内调用本地打电话功能-make a phone call
- 织梦 Call to undefined function make_hash()解决方法
- make android 时的 libwebcore.so error
- Use VBA to call Web Service
- MSDN Webcast - Silverlight for Windows Phone 开发系列课程(2):Windows Phone开发环境搭建
- Web_PHP_织梦更新列表页提示Fatal error: Call to a member function GetInnerText() on a non-object in ...
- [FAQ12564]【Phone Call】双拨号键对应SIM卡拨打电话的实现
- linphone-LinphoneCallLogImpl文件对应的JNI层文件分析
- Xcode6.1使用MJRefresh、SDWebImage,Too many arguments to function call, expected 0, have *
- linphone-LinphoneCallStatsImpl文件对应的JNI分析