androidgoogle-glassgoogle-gdkgoogle-glass-camera

How to disable progress bar after taking a photo with camera?


Is it possible, to disable the progress bar after taking a photo with camera (using Google Glass)? I try to automatically take a photo every 2 seconds using Google Glass but when I am taking a photo while the progress bar is shown, the onActivityResult() method returns null.

[EDIT 1]:

I have no progress bar defined in my activity.xml layout, so I have no mProgressbar variable, where I could set mProgressbar.dismiss()

Code:

private fun takePicture() {
    val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
    startActivityForResult(intent, TAKE_PICTURE_REQUEST)
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {

    if (requestCode == TAKE_PICTURE_REQUEST && resultCode == Activity.RESULT_OK) {
        val picturePath = data.getStringExtra(Intents.EXTRA_PICTURE_FILE_PATH)
        val bitmap: Bitmap = BitmapFactory.decodeFile(pictureFile.absolutePath)
        picture_imageview.setImageBitmap(bitmap)
    }

    super.onActivityResult(requestCode, resultCode, data)
}

Progress bar appears even in the case when I comment out every line in the onActivityResult() method.


Solution

  • Solved it, have to call the camera directly.