zoukankan      html  css  js  c++  java
  • 安卓---读取照片---拍照

    实例讲述android打开本地图像的方法。分享给大家供大家参考。具体如下:

    方法一,调用手机安装的图像浏览工具浏览:

    Intent intent = new Intent();
    intent.setType("image/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    startActivityForResult(intent, 1);
    

     方法二,调用手机自身图像浏览工具浏览:

    Intent intent = new Intent(
      Intent.ACTION_PICK,
      android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
      intent.setType("image/*");
      PackageManager manager = getPackageManager();
      List<ResolveInfo> apps = manager.queryIntentActivities(intent,
       0);
      if (apps.size() > 0) {
       startActivityForResult(intent, 0x2001);
      }
       
  • 相关阅读:
    touch
    ls
    Linux基础
    errors
    strconv
    strings
    fmt
    os/exec
    笔记本连不上网怎么办
    笔记本连不上网怎么办
  • 原文地址:https://www.cnblogs.com/rainday1/p/5761744.html
Copyright © 2011-2022 走看看