本页文章导读:
▪Java -进制转换方法 Java -----进制转换方法
十进制转成十六进制:
Integer.toHexString(int i)
十进制转成八进制
Integer.toOctalString(int i)
十进制转成二进制
Integer.toBinaryString(int.........
▪ intent的低级异常 intent的低级错误
调web浏览器时
String url = "http://xxxxx.com"; //这个url前面的http不能少,否则会报ActivityNotFoundException错误
Uri myBlogUri = Uri.parse(url );
web = new Intent(Intent.ACTION_VIEW, myBlogUri);
......
▪ 【转】intent步骤使用总结 【转】intent方法使用总结
1. //show webapp:
2.
3. Uri uri = Uri.parse("http://www.google.com");
4. Intent it = new Intent(Intent.ACTION_VIEW,uri);
5. startActivity(it);
6.
7. //show maps:
8. Uri uri = U.........
[1]Java -进制转换方法
来源: 互联网 发布时间: 2014-02-18
Java -----进制转换方法
十进制转成十六进制:
Integer.toHexString(int i)
十进制转成八进制
Integer.toOctalString(int i)
十进制转成二进制
Integer.toBinaryString(int i)
十六进制转成十进制
Integer.valueOf("FFFF",16).toString()
八进制转成十进制
Integer.valueOf("876",8).toString()
二进制转十进制
Integer.valueOf("0101",2).toString()
http://blog.csdn.net/szwangdf/archive/2008/07/01/2601941.aspx
[2] intent的低级异常
来源: 互联网 发布时间: 2014-02-18
intent的低级错误
调web浏览器时
String url = "http://xxxxx.com"; //这个url前面的http不能少,否则会报ActivityNotFoundException错误
Uri myBlogUri = Uri.parse(url );
web = new Intent(Intent.ACTION_VIEW, myBlogUri);
[3] 【转】intent步骤使用总结
来源: 互联网 发布时间: 2014-02-18
【转】intent方法使用总结
1. //show webapp: 2. 3. Uri uri = Uri.parse("http://www.google.com"); 4. Intent it = new Intent(Intent.ACTION_VIEW,uri); 5. startActivity(it); 6. 7. //show maps: 8. Uri uri = Uri.parse("geo:38.899533,-77.036476"); 9. Intent it = new Intent(Intent.Action_VIEW,uri); 10. startActivity(it); 11. 12. //show ways 13. Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en"); 14. Intent it = new Intent(Intent.ACTION_VIEW,URI); 15. startActivity(it); 16. 17. //call dial program 18. Uri uri = Uri.parse("tel:xxxxxx"); 19. Intent it = new Intent(Intent.ACTION_DIAL, uri); 20. startActivity(it); 21. 22. Uri uri = Uri.parse("tel.xxxxxx"); 23. Intent it =new Intent(Intent.ACTION_CALL,uri); 24. //don't forget add this config:<uses-permission id="android.permission.CALL_PHONE" /> 25. 26. //send sms/mms 27. //call sender program 28. Intent it = new Intent(Intent.ACTION_VIEW); 29. it.putExtra("sms_body", "The SMS text"); 30. it.setType("vnd.android-dir/mms-sms"); 31. startActivity(it); 32. 33. //send sms 34. Uri uri = Uri.parse("smsto:0800000123"); 35. Intent it = new Intent(Intent.ACTION_SENDTO, uri); 36. it.putExtra("sms_body", "The SMS text"); 37. startActivity(it); 38. 39. //send mms 40. Uri uri = Uri.parse("content://media/external/images/media/23"); 41. Intent it = new Intent(Intent.ACTION_SEND); 42. it.putExtra("sms_body", "some text"); 43. it.putExtra(Intent.EXTRA_STREAM, uri); 44. it.setType("image/png"); 45. startActivity(it); 46. 47. //send email 48. 49. Uri uri = Uri.parse("mailto:xxx@abc.com"); 50. Intent it = new Intent(Intent.ACTION_SENDTO, uri); 51. startActivity(it); 52. 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. 59. Intent it=new Intent(Intent.ACTION_SEND); 60. String[] tos={"me@abc.com"}; 61. String[] ccs={"you@abc.com"}; 62. it.putExtra(Intent.EXTRA_EMAIL, tos); 63. it.putExtra(Intent.EXTRA_CC, ccs); 64. it.putExtra(Intent.EXTRA_TEXT, "The email body text"); 65. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text"); 66. it.setType("message/rfc822"); 67. startActivity(Intent.createChooser(it, "Choose Email Client")); 68. 69. 70. //add extra 71. Intent it = new Intent(Intent.ACTION_SEND); 72. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text"); 73. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3"); 74. sendIntent.setType("audio/mp3"); 75. startActivity(Intent.createChooser(it, "Choose Email Client")); 76. 77. //play media 78. Intent it = new Intent(Intent.ACTION_VIEW); 79. Uri uri = Uri.parse("file:///sdcard/song.mp3"); 80. it.setDataAndType(uri, "audio/mp3"); 81. startActivity(it); 82. 83. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1"); 84. Intent it = new Intent(Intent.ACTION_VIEW, uri); 85. startActivity(it); 86. 87. //Uninstall 88. Uri uri = Uri.fromParts("package", strPackageName, null); 89. Intent it = new Intent(Intent.ACTION_DELETE, uri); 90. startActivity(it); 91. 92. //uninstall apk 93. Uri uninstallUri = Uri.fromParts("package", "xxx", null); 94. returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri); 95. 96. //install apk 97. Uri installUri = Uri.fromParts("package", "xxx", null); 98. returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri); 99. 100. //play audio 101. Uri playUri = Uri.parse("file:///sdcard/download/everything.mp3"); 102. returnIt = new Intent(Intent.ACTION_VIEW, playUri); 103. 104. //send extra 105. Intent it = new Intent(Intent.ACTION_SEND); 106. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text"); 107. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/eoe.mp3"); 108. sendIntent.setType("audio/mp3"); 109. startActivity(Intent.createChooser(it, "Choose Email Client")); 110. 111. //search 112. Uri uri = Uri.parse("market://search?q=pname:pkg_name"); 113. Intent it = new Intent(Intent.ACTION_VIEW, uri); 114. startActivity(it); 115. //where pkg_name is the full package path for an application 116. 117. //show program detail page 118. Uri uri = Uri.parse("market://details?id=app_id"); 119. Intent it = new Intent(Intent.ACTION_VIEW, uri); 120. startActivity(it); 121. //where app_id is the application ID, find the ID 122. //by clicking on your application on Market home 123. //page, and notice the ID from the address bar 124. 125. 126. //search google 127. Intent intent = new Intent(); 128. intent.setAction(Intent.ACTION_WEB_SEARCH); 129. intent.putExtra(SearchManager.QUERY,"searchString") 130. startActivity(intent);
最新技术文章: