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);  

相关文章:

  • 2022-12-23
  • 2019-12-26
  • 2021-09-09
  • 2021-09-01
  • 2021-12-18
  • 2021-11-20
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2021-09-09
  • 2021-11-16
相关资源
相似解决方案