org.artoolkitx.arx.arxj

## Class ARActivity

- java.lang.Object
- - Activity
  - - org.artoolkitx.arx.arxj.ARActivity

-     public abstract class ARActivity
      extends Activity

  An activity which can be subclassed to create an AR application. ARActivity handles almost all of the required operations to create a simple augmented reality application.
  ARActivity automatically creates a camera preview surface and an OpenGL surface view, and arranges these correctly in the user interface.The subclass simply needs to provide a FrameLayout object which will be populated with these UI components, using `supplyFrameLayout`.
  To create a custom AR experience, the subclass should also provide a custom renderer using `Renderer`. This allows the subclass to handle OpenGL drawing calls on its own.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `REQUEST_CAMERA_PERMISSION_RESULT` Used to match-up permission user request to user response

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ARActivity()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Context` | `getAppContext()`
    `GLSurfaceView` | `getGLView()` Returns the GL surface view.
    `ARRenderer` | `getRenderer()`
    `void` | `onClick(View v)`
    `protected void` | `onCreate(Bundle savedInstanceState)`
    `boolean` | `onCreateOptionsMenu(Menu menu)`
    `boolean` | `onOptionsItemSelected(MenuItem item)`
    `protected void` | `onPause()`
    `void` | `onRequestPermissionsResult(int requestCode, java.lang.String[] permissions, int[] grantResults)`
    `void` | `onResume()`
    `protected void` | `onStart()`
    `void` | `onStop()`
    `void` | `onWindowFocusChanged(boolean hasFocus)`
    `protected void` | `showInfo()`
    `protected abstract FrameLayout` | `supplyFrameLayout()` Allows subclasses to supply a `FrameLayout` which will be populated with a camera preview and GL surface view.
    `protected abstract ARRenderer` | `supplyRenderer()` Allows subclasses to supply a custom `Renderer`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### REQUEST_CAMERA_PERMISSION_RESULT

          public static final int REQUEST_CAMERA_PERMISSION_RESULT

      Used to match-up permission user request to user response
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ARActivity

          public ARActivity()

  - ### Method Detail

    - #### getAppContext

          public Context getAppContext()

    - #### onCreate

          protected void onCreate(Bundle savedInstanceState)

    - #### supplyRenderer

          protected abstract ARRenderer supplyRenderer()

      Allows subclasses to supply a custom `Renderer`.
      Returns:
        The `Renderer` to use.

    - #### supplyFrameLayout

          protected abstract FrameLayout supplyFrameLayout()

      Allows subclasses to supply a `FrameLayout` which will be populated with a camera preview and GL surface view.
      Returns:
        The `FrameLayout` to use.

    - #### onStart

          protected void onStart()

    - #### onResume

          public void onResume()

    - #### onPause

          protected void onPause()

    - #### onStop

          public void onStop()

    - #### onCreateOptionsMenu

          public boolean onCreateOptionsMenu(Menu menu)

    - #### onOptionsItemSelected

          public boolean onOptionsItemSelected(MenuItem item)

    - #### showInfo

          protected void showInfo()

    - #### onWindowFocusChanged

          public void onWindowFocusChanged(boolean hasFocus)

    - #### onClick

          public void onClick(View v)

    - #### onRequestPermissionsResult

          public void onRequestPermissionsResult(int requestCode,
                                                 @NonNull
                                                 java.lang.String[] permissions,
                                                 @NonNull
                                                 int[] grantResults)

    - #### getGLView

          public GLSurfaceView getGLView()

      Returns the GL surface view.
      Returns:
        The GL surface view.

    - #### getRenderer

          public ARRenderer getRenderer()