当前位置:  ▪Android显式启动与隐式启动Activity的区别介绍 iis7站长之家
本页文章导读:
    ▪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);  
     

        
    最新技术文章:
    ▪Android开发之登录验证实例教程
    ▪Android开发之注册登录方法示例
    ▪Android获取手机SIM卡运营商信息的方法
    ▪Android实现将已发送的短信写入短信数据库的...
    ▪Android发送短信功能代码
    ▪Android根据电话号码获得联系人头像实例代码
    ▪Android中GPS定位的用法实例
    ▪Android实现退出时关闭所有Activity的方法
    ▪Android实现文件的分割和组装
    ▪Android录音应用实例教程
    ▪Android双击返回键退出程序的实现方法
    ▪Android实现侦听电池状态显示、电量及充电动...
    ▪Android获取当前已连接的wifi信号强度的方法
    ▪Android实现动态显示或隐藏密码输入框的内容
    ▪根据USER-AGENT判断手机类型并跳转到相应的app...
    ▪Android Touch事件分发过程详解
    ▪Android中实现为TextView添加多个可点击的文本
    ▪Android程序设计之AIDL实例详解
    ▪Android显式启动与隐式启动Activity的区别介绍
    ▪Android按钮单击事件的四种常用写法总结
    ▪Android消息处理机制Looper和Handler详解
    ▪Android实现Back功能代码片段总结
    ▪Android实用的代码片段 常用代码总结
    ▪Android实现弹出键盘的方法
    ▪Android中通过view方式获取当前Activity的屏幕截...
    ▪Android提高之自定义Menu(TabMenu)实现方法
    ▪Android提高之多方向抽屉实现方法
    ▪Android提高之MediaPlayer播放网络音频的实现方法...
    ▪Android提高之MediaPlayer播放网络视频的实现方法...
    ▪Android提高之手游转电视游戏的模拟操控
     


    站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3