---
name: "SDL_GetAndroidActivity"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_GetAndroidActivity"
---

# SDL\_GetAndroidActivity(3)

Retrieve the Java instance of the Android activity class.

## NAME

SDL\_GetAndroidActivity - Retrieve the Java instance of the Android activity class.

## HEADER FILE

Defined in SDL3/SDL\_system.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**void \* SDL\_GetAndroidActivity(void);**

## DESCRIPTION

The prototype of the function in SDL's code actually declares a void\* return type, even if the implementation returns a jobject. The rationale being that the SDL headers can avoid including jni.h.

The jobject returned by the function is a local reference and must be released by the caller. See the PushLocalFrame() and PopLocalFrame() or DeleteLocalRef() functions of the Java native interface:

https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html

## RETURN VALUE

Returns the jobject representing the instance of the Activity class of the Android application, or NULL on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetAndroidJNIEnv**(3)](/SDL_GetAndroidJNIEnv/3.md)
