• 调用系统程序


    拨打电话

    1 Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"
    2                         + "4006-513520"));
    3                 startActivity(intent);

    发送短信

    1 Intent intent = new Intent(Intent.ACTION_VIEW);
    2                 intent.setType("vnd.android-dir/mms-sms");
    3                 startActivity(intent);

    发送邮件

    1 Intent intent = new Intent(Intent.ACTION_SENDTO, Uri
    2                         .parse("mailto:daishuguang4461@126.com"));
    3                 startActivity(intent);

    拍照

    1 // 拍照我们用 Action为MediaStore.ACTION_IMAGE_CAPTURE,
    2                 // 有些人使用其他的Action但我发现在有些机子中会出问题,所以优先选择这个
    3                 intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    4 
    5                 fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
    6                 intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
    7                 startActivityForResult(intent,
    8                         CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

    相册

    1 // 选择照片的时候也一样,我们用Intent.ACTION_GET_CONTENT
    2                 intent = new Intent(Intent.ACTION_PICK);
    3                 intent.setType("image/*");
    4                 startActivityForResult(intent, 2);
  • 相关阅读:
    myeclise中创建maven web程序
    java定时任务调度工具
    fastjson常用方法
    log4j2的配置及使用
    spring事务配置
    java利用poi解析excel文件
    ScheduledTheadPool线程池的使用
    ThreadPoolExecutor线程池
    jQuery属性操作(一)
    jQuery队列(三)
  • 原文地址:https://www.cnblogs.com/daishuguang/p/3885177.html
Copyright © 2020-2023  润新知