代码之家  ›  专栏  ›  技术社区  ›  AVEbrahimi

安卓意图。ACTION\u PICK not closing picker if crop is selected ACTION\u PICK not closing picker if crop is selected

  •  0
  • AVEbrahimi  · 技术社区  · 7 年前

    当我试图从gallery中选择一张照片并设置 庄稼 ,单击复选标记将不会关闭对话框,它将保持在选择器对话框中,但如果我只是删除 意图putExtra(“作物”、“真实”) 它会正常工作!:

                            val intent = Intent(
                                    Intent.ACTION_PICK,
                                    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
                            intent.type = "image/*"
                            intent.putExtra("crop", "true")
                            intent.putExtra("scale", true)
                            intent.putExtra("aspectX", 1)
                            intent.putExtra("aspectY", 1)
                            // indicate output X and Y
                            intent.putExtra("return-data", true)
                            intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString())
                            startActivityForResult(
                                    Intent.createChooser(intent, getString(R.string.select_photo)),
                                    REQUETS_SELECT_PICTURE)
    

    enter image description here

    0 回复  |  直到 7 年前
    推荐文章