zoukankan      html  css  js  c++  java
  • Intent调用大全,史上最全的

     
    1. //调用浏览器  
    2. Uri uri = Uri.parse("");  
    3. Intent it  = new Intent(Intent.ACTION_VIEW,uri);  
    4. startActivity(it);  
    1. //显示某个坐标在地图上  
    2. Uri uri = Uri.parse("geo:38.899533,-77.036476");  
    3. Intent it = new Intent(Intent.Action_VIEW,uri);  
    4. startActivity(it);  
    1. //显示路径  
    2. Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");  
    3. Intent it = new Intent(Intent.ACTION_VIEW,URI);  
    4. startActivity(it);  
    1. //拨打电话  
    2. Uri uri = Uri.parse("tel:10086");  
    3. Intent it = new Intent(Intent.ACTION_DIAL, uri);    
    4. startActivity(it);   
    5. Uri uri = Uri.parse("tel.10086");  
    6. Intent it =new Intent(Intent.ACTION_CALL,uri);  



    需要添加 <uses-permission id="Android.permission.CALL_PHONE" /> 这个权限到androidmanifest.xml

    1. //发送短信或彩信  
    2. Intent it = new Intent(Intent.ACTION_VIEW);     
    3. it.putExtra("sms_body""The SMS text");     
    4. it.setType("vnd.android-dir/mms-sms");     
    5. startActivity(it);   
    1. //发送短信  
    2. Uri uri = Uri.parse("smsto:10086");     
    3. Intent it = new Intent(Intent.ACTION_SENDTO, uri);     
    4. it.putExtra("sms_body""cwj");     
    5. startActivity(it);   
    1. //发送彩信  
    2. Uri uri = Uri.parse("content://media/external/images/media/23");     
    3. Intent it = new Intent(Intent.ACTION_SEND);     
    4. it.putExtra("sms_body""some text");     
    5. it.putExtra(Intent.EXTRA_STREAM, uri);     
    6. it.setType("image/png");     
    7. startActivity(it);  
    1. //发送邮件   
    2. Uri uri = Uri.parse("mailto:android123@163.com");  
    3. Intent it = new Intent(Intent.ACTION_SENDTO, uri);  
    4. startActivity(it);  
    5. Intent it = new Intent(Intent.ACTION_SEND);     
    6. it.putExtra(Intent.EXTRA_EMAIL, android123@163.com);     
    7. it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
    8. it.setType("text/plain");     
    9. startActivity(Intent.createChooser(it, "Choose Email Client"));   
    10. Intent it=new Intent(Intent.ACTION_SEND);       
    11. String[] tos={"me@abc.com"};       
    12. String[] ccs={"you@abc.com"};       
    13. it.putExtra(Intent.EXTRA_EMAIL, tos);       
    14. it.putExtra(Intent.EXTRA_CC, ccs);       
    15. it.putExtra(Intent.EXTRA_TEXT, "The email body text");       
    16. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");       
    17. it.setType("message/rfc822");       
    18. startActivity(Intent.createChooser(it, "Choose Email Client"));  
    1. //播放媒体文件  
    2. Intent it = new Intent(Intent.ACTION_VIEW);  
    3. Uri uri = Uri.parse("file:///sdcard/cwj.mp3");  
    4. it.setDataAndType(uri, "audio/mp3");  
    5. startActivity(it);  
    6. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");     
    7. Intent it = new Intent(Intent.ACTION_VIEW, uri);     
    8. startActivity(it);   
    1. //卸载APK  
    2. Uri uri = Uri.fromParts("package", strPackageName, null);     
    3. Intent it = new Intent(Intent.ACTION_DELETE, uri);     
    4. startActivity(it);  
    5. //卸载apk 2  
    6. Uri uninstallUri = Uri.fromParts("package""xxx", null);  
    7. returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri);  
    8. //安装APK  
    9. Uri installUri = Uri.fromParts("package""xxx", null);  
    10. returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);  
    1. //播放音乐  
    2. Uri playUri = Uri.parse("file:///sdcard/download/sth.mp3");  
    3. returnIt = new Intent(Intent.ACTION_VIEW, playUri);  
    1. //发送附近  
    2. Intent it = new Intent(Intent.ACTION_SEND);    
    3. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");    
    4. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/cwj.mp3");    
    5. sendIntent.setType("audio/mp3");    
    6. startActivity(Intent.createChooser(it, "Choose Email Client"));  
    1. //market上某个应用信,pkg_name就是应用的packageName  
    2. Uri uri = Uri.parse("market://search?q=pname:pkg_name");    
    3. Intent it = new Intent(Intent.ACTION_VIEW, uri);    
    4. startActivity(it);   
    1. //market上某个应用信息,app_id可以通过www网站看下  
    2. Uri uri = Uri.parse("market://details?id=app_id");    
    3. Intent it = new Intent(Intent.ACTION_VIEW, uri);    
    4. startActivity(it);    
    1. //调用搜索  
    2. Intent intent = new Intent();  
    3. intent.setAction(Intent.ACTION_WEB_SEARCH);  
    4. intent.putExtra(SearchManager.QUERY,"android123")  
    5. startActivity(intent);  
    aliyun活动 https://www.aliyun.com/acts/limit-buy?userCode=re2o7acl
  • 相关阅读:
    jquery---stop()
    标准设备的-media queries
    CSS3 Media Queries
    css---------selector
    sublime----(1)
    XAMPP、WAMP、appserv
    Express.js----路由
    nodejs----上传显示图片
    node.js-----处理POST请求
    DotNetOpenAuth使用笔记
  • 原文地址:https://www.cnblogs.com/wangbin/p/2290064.html
Copyright © 2011-2022 走看看