【问题标题】:Intent to open default camera in square mode意图以方形模式打开默认相机
【发布时间】:2019-09-30 04:59:23
【问题描述】:

我可以通过这个意图打开相机:

Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

                // Ensure that there's a camera activity to handle the intent
                if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
                    // Create the File where the photo should go
                    File photoFile = null;
                    try {
                        photoFile = Utility.createImageFile(BotActivity.this);
                    } catch (IOException ex) {
                        // Error occurred while creating the File

                    }
                    // Continue only if the File was successfully created
                    if (photoFile != null) {
                        Uri photoURI = FileProvider.getUriForFile(BotActivity.this,
                                "com.kutumbita.app.fileprovider",
                                photoFile);

                        takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
                        startActivityForResult(takePictureIntent, CAMERA_CAPTURE_REQUEST);
                    }
                }

有什么办法可以启动方形尺寸的相机吗?

【问题讨论】:

    标签: android android-intent android-camera


    【解决方案1】:

    我已经找到了解决方案,这对于原生 android sdk 是不可能的。谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-09-24
      • 1970-01-01
      • 2021-09-18
      • 2018-06-06
      • 2013-05-23
      • 1970-01-01
      • 2016-10-11
      相关资源
      最近更新 更多