com.craftar
Class CraftARActivityCompat
- java.lang.Object
-
- AppCompatActivity
-
- com.craftar.CraftARActivityCompat
public abstract class CraftARActivityCompat extends AppCompatActivity
Activities using the CraftAR SDK must extend this class instead of extending from AppCompatActivity. This class maintains the internal state of the CraftAR SDK resources, such as the camera, etc. Make sure to call super if you override theCraftARActivity.onBackPressed()
orCraftARActivity.finish()
methods.
-
-
Constructor Summary
Constructors Constructor and Description CraftARActivityCompat()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description void
finish()
If you override this method, callsuper.finish();
in your Activity.void
onBackPressed()
If you override this method, callsuper.onBackPressed();
in your Activity.abstract void
onCameraOpenFailed()
Triggered when there was an error opening the camera.void
onCameraReleased()
Triggered when the camera is releasedvoid
onCreate(Bundle savedInstanceState)
onCreate should not be used to load the content view for Activities using the CraftAR SDK, they should override theCraftARActivity.onPostCreate()
method instead to load the content view.void
onPause()
If you override this method, callsuper.onPause()
in your Activity.abstract void
onPostCreate()
Called just after onCreate finishes.void
onPreviewFrame(byte[] RGBframe)
abstract void
onPreviewStarted(int width, int height)
void
onResume()
If you override this method, callsuper.onResume()
in your Activity.void
setContentView(View v)
-
-
-
Method Detail
-
onCreate
public void onCreate(Bundle savedInstanceState)
onCreate should not be used to load the content view for Activities using the CraftAR SDK, they should override theCraftARActivity.onPostCreate()
method instead to load the content view.
Note: it is safe to use it to get information from the received Bundle.
-
setContentView
public void setContentView(View v)
-
onResume
public void onResume()
If you override this method, callsuper.onResume()
in your Activity. It is necessary to release the camera hardware for other applications.
-
onPause
public void onPause()
If you override this method, callsuper.onPause()
in your Activity. It is necessary to release the camera hardware for other applications.
-
finish
public void finish()
If you override this method, callsuper.finish();
in your Activity. It is necessary to release the camera hardware for other applications.
-
onBackPressed
public void onBackPressed()
If you override this method, callsuper.onBackPressed();
in your Activity. It is necessary to release the camera hardware for other applications
-
onPostCreate
public abstract void onPostCreate()
Called just after onCreate finishes. Can be used to load the content view for Activities using the CraftAR SDK.
-
onCameraOpenFailed
public abstract void onCameraOpenFailed()
Triggered when there was an error opening the camera. This normally happens when another app left the camera open (i.e. the flashlight), or when the camera was not correctly released by the Android OS when closing some app.
-
onCameraReleased
public void onCameraReleased()
Triggered when the camera is released
-
onPreviewFrame
public void onPreviewFrame(byte[] RGBframe)
-
onPreviewStarted
public abstract void onPreviewStarted(int width, int height)
-
-