zoukankan      html  css  js  c++  java
  • Android中调用照相机拍照

                      Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                      String strPath = Environment.getExternalStorageDirectory() +File.separator;
                      File path = new File(strPath);
                      if(!path.exists())
                      path.mkdirs();
                      String strFileName = "test.jpg";
                      String strFilePath = strPath + "/" + strFileName;
     
                      File file = new File(strFilePath);
                      Uri uri = Uri.fromFile(file);
                      intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
                      startActivityForResult(intent, 1);  
  • 相关阅读:
    zipalign内存对齐优化
    反编译 waring...
    android.os.NetworkOnMainThreadException
    android:LayoutInflater
    Notification NotificationManager RemoteViews PendingIntent
    WebView WebViewClient WebChromeClient
    寒假1
    冻死可怕了
    一个人失眠
    军训快乐
  • 原文地址:https://www.cnblogs.com/yangzhenyu/p/2219399.html
Copyright © 2011-2022 走看看