title: onActivityResult is not called (Kotlin)
body: <p>I need help. On my <code>onCreate()</code> I have this code:</p>
  
  <pre><code>    takePhotoDialog = DialogGetPhotoFrom.getInstance().apply {
          setListener(object : DialogGetPhotoFrom.DialogListener {
              override fun onTakeFromGallery() {
                  Log.v("ProjectDetails", "onTakeFromGallery called")
                  val intent = Intent().apply {
                      type = "image/*"
                      action = Intent.ACTION_GET_CONTENT
                  }
                  startActivityForResult(Intent.createChooser(intent, "Select Image"), REQUEST_PICK_IMAGE)
              }
  
              override fun onTakePhoto() {
                  dispatchTakePictureIntent()
              }
          })
      }
  
      projectDetails_pickImage.setOnClickListener { takePhotoDialog?.show(supportFragmentManager) }
  </code></pre>
  
  <p>An on my <code>onActivityResult</code>, I wrote:</p>
  
  <pre><code>override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
      super.onActivityResult(requestCode, resultCode, data)
      when (requestCode) {
          REQUEST_PICK_IMAGE -&gt; {
              Log.v("ProjectDetails", "REQUEST_PICK_IMAGE called")
              if (resultCode == Activity.RESULT_OK) {
                  if (data != null) {
                      try {
                          val inputStream = contentResolver.openInputStream(data.data)
                          val bitMap = BitmapFactory.decodeStream(inputStream)
                          projectDetails_image.setImageBitmap(bitMap)
                          // TODO Save image URI to database
                      } catch (e: Exception) {
                          Toast.makeText(this, "Can't set background.", Toast.LENGTH_SHORT).show()
                      }
                  } else {
                      Log.v("ProjectDetails", "data is null")
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>The problem is, <code>onActivityResult()</code> doesn't fire when an image is selected. What should I do?</p>