zoukankan      html  css  js  c++  java
  • 每日日报

    Intent的基本使用

    //1.拨打电话
    // 给移动客服10086拨打电话
    Uri uri = Uri.parse("tel:10086");
    Intent intent = new Intent(Intent.ACTION_DIAL, uri);
    startActivity(intent);
    
    //===============================================================
    
    //2.发送短信
    // 给10086发送内容为“Hello”的短信
    Uri uri = Uri.parse("smsto:10086");
    Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
    intent.putExtra("sms_body", "Hello");
    startActivity(intent);
    
    //3.发送彩信(相当于发送带附件的短信)
    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.putExtra("sms_body", "Hello");
    Uri uri = Uri.parse("content://media/external/images/media/23");
    intent.putExtra(Intent.EXTRA_STREAM, uri);
    intent.setType("image/png");
    startActivity(intent);
    
    //===============================================================
    
    //4.打开浏览器:
    // 打开百度主页
    Uri uri = Uri.parse("http://www.baidu.com");
    Intent intent  = new Intent(Intent.ACTION_VIEW, uri);
    startActivity(intent);
  • 相关阅读:
    js location.href ,location.replace, location.reload
    //js date对象常用方法
    js Math对象常用方法
    n sum
    two sum
    树:树中两个节点的最低公共祖先
    C++11:智能指针与lambda表达式
    回溯: 0-1背包
    动态库的soname实验
    DNS介绍与安装使用
  • 原文地址:https://www.cnblogs.com/zy2481912102/p/14909420.html
Copyright © 2011-2022 走看看