Google is committed to advancing racial equity for Black communities. See how.

ActivityResultContracts.TakePicturePreview

public static class ActivityResultContracts.TakePicturePreview
extends ActivityResultContract<Void, Bitmap>

java.lang.Object
   ↳ androidx.activity.result.contract.ActivityResultContract<java.lang.Void, android.graphics.Bitmap>
     ↳ androidx.activity.result.contract.ActivityResultContracts.TakePicturePreview


An ActivityResultContract to take small a picture preview, returning it as a Bitmap.

This can be extended to override ActivityResultContract.createIntent(Context, I) if you wish to pass additional extras to the Intent created by super.createIntent().

Summary

Public constructors

TakePicturePreview()

Public methods

Intent createIntent(Context context, Void input)

Create an intent that can be used for Activity.startActivityForResult(Intent, int)

final SynchronousResult<Bitmap> getSynchronousResult(Context context, Void input)

An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity.

final Bitmap parseResult(int resultCode, Intent intent)

Convert result obtained from Activity.onActivityResult(int, int, Intent) to O

Inherited methods

Public constructors

TakePicturePreview

public TakePicturePreview ()

Public methods

createIntent

public Intent createIntent (Context context, 
                Void input)

Create an intent that can be used for Activity.startActivityForResult(Intent, int)

Parameters
context Context

input Void

Returns
Intent

getSynchronousResult

public final SynchronousResult<Bitmap> getSynchronousResult (Context context, 
                Void input)

An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity.

Parameters
context Context

input Void

Returns
SynchronousResult<Bitmap> the result wrapped in a ActivityResultContract.SynchronousResult or null if the call should proceed to start an activity.

parseResult

public final Bitmap parseResult (int resultCode, 
                Intent intent)

Convert result obtained from Activity.onActivityResult(int, int, Intent) to O

Parameters
resultCode int

intent Intent

Returns
Bitmap