Intent Usage set

Source: Internet
Author: User
  1. // Display the webpage
  2. Uri uri = URI. parse ("http://google.com ");
  3. Intent it = new intent (intent. action_view, Uri );
  4. Startactivity (it );
  5. // Display the map
  6. Uri uri = URI. parse ("Geo: 38.899533,-77.036476 ");
  7. Intent it = new intent (intent. action_view, Uri );
  8. Startactivity (it );
  9. // Other geo uri examples
  10. // GEO: latitude, longpolling
  11. // GEO: latitude, longpolling? Z = zoom
  12. // GEO: 0, 0? Q = My + street + address
  13. // GEO: 0, 0? Q = business + near + city
  14. // Google. Streetview: cbll = Lat, LNG & white = 1, yaw, pitch, zoom & MZ = mapzoom
  15. // Route Planning
  16. Uri uri = URI. parse ("http://maps.google.com/maps? F = D & saddr = startlat % 20 startlng & daddr = endlat20endlng & HL = EN ");
  17. Intent it = new intent (intent. action_view, Uri );
  18. Startactivity (it );
  19. // Where startlat, startlng, endlat, endlng are a long with 6 decimals like: 50.123456
  20. // Call
  21. // Call the dialing program
  22. Uri uri = URI. parse ("Tel: 0800000123 ");
  23. Intent it = new intent (intent. action_dial, Uri );
  24. Startactivity (it );
  25. // Directly call out
  26. Uri uri = URI. parse ("Tel: 0800000123 ");
  27. Intent it = new intent (intent. action_call, Uri );
  28. Startactivity (it );
  29. // Add this parameter to androidmanifest. xml
  30. // <Uses-Permission id = "android. Permission. call_phone"/>
  31. // Send SMS/MMS
  32. // Call the SMS Program
  33. Intent it = new intent (intent. action_view, Uri );
  34. It. putextra ("sms_body", "the SMS text ");
  35. It. settype ("Vnd. Android-DIR/MMS-SMS ");
  36. Startactivity (it );
  37. // Send messages
  38. Uri uri = URI. parse ("smsto: // 0800000123 ");
  39. Intent it = new intent (intent. action_sendto, Uri );
  40. It. putextra ("sms_body", "the SMS text ");
  41. Startactivity (it );
  42. // Send MMS
  43. Uri uri = URI. parse ("content: // media/external/images/Media/23 ");
  44. Intent it = new intent (intent. action_send );
  45. It. putextra ("sms_body", "some text ");
  46. It. putextra (intent. extra_stream, Uri );
  47. It. settype ("image/PNG ");
  48. Startactivity (it );
  49. // Send email
  50. Uri uri = URI. parse ("mailto: xxx@abc.com ");
  51. Intent it = new intent (intent. action_sendto, Uri );
  52. Startactivity (it );
  53. Intent it = new intent (intent. action_send );
  54. It. putextra (intent. extra_email, "me@abc.com ");
  55. It. putextra (intent. extra_text, "the email body text ");
  56. It. settype ("text/plain ");
  57. Startactivity (intent. createchooser (IT, "Choose email client "));
  58. Intent it = new intent (intent. action_send );
  59. String [] TOS = {"me@abc.com "};
  60. String [] CCS = {"you@abc.com "};
  61. It. putextra (intent. extra_email, TOS );
  62. It. putextra (intent. extra_cc, CCS );
  63. It. putextra (intent. extra_text, "the email body text ");
  64. It. putextra (intent. extra_subject, "the email subject text ");
  65. It. settype ("message/rfc822 ");
  66. Startactivity (intent. createchooser (IT, "Choose email client "));
  67. // Transfer the attachment
  68. Intent it = new intent (intent. action_send );
  69. It. putextra (intent. extra_subject, "the email subject text ");
  70. It. putextra (intent. extra_stream, "file: // sdcard/mysong.mp3 ");
  71. Sendintent. settype ("audio/MP3 ");
  72. Startactivity (intent. createchooser (IT, "Choose email client "));
  73. // Play multimedia
  74. Uri uri = URI. parse ("file: // sdcard/song.mp3 ");
  75. Intent it = new intent (intent. action_view, Uri );
  76. It. settype ("audio/MP3 ");
  77. Startactivity (it );
  78. Uri uri = URI. withappendedpath (mediastore. Audio. Media. internal_content_uri, "1 ");
  79. Intent it = new intent (intent. action_view, Uri );
  80. Startactivity (it );
  81. // Related to market
  82. // Search for an application
  83. Uri uri = URI. parse ("Market: // search? Q = pname: pkg_name ");
  84. Intent it = new intent (intent. action_view, Uri );
  85. Startactivity (it );
  86. // Where pkg_name is the full package path for an application
  87. // Display information about an application
  88. Uri uri = URI. parse ("Market: // details? Id = app_id ");
  89. Intent it = new intent (intent. action_view, Uri );
  90. Startactivity (it );
  91. // Where app_id is the Application ID, find the ID
  92. // By clicking on your application on market Home
  93. // Page, and notice the ID from the address bar
  94. // Uninstall the application
  95. Uri uri = URI. fromparts ("package", strpackagename, null );
  96. Intent it = new intent (intent. action_delete, Uri );
  97. Startactivity (it );
  98. Note: The above can be verified by yourself, and the author is verifying...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.