activity

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package activity provides Go bindings for Android NativeActivity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLifecycleCallbacks

func SetLifecycleCallbacks(cb LifecycleCallbacks)

SetLifecycleCallbacks registers callbacks for the lifecycle events.

Types

type Activity

type Activity struct {
	// contains filtered or unexported fields
}

Activity wraps the NDK ANativeActivity handle.

func NewActivityFromPointer

func NewActivityFromPointer(ptr unsafe.Pointer) *Activity

NewActivityFromPointer wraps a raw ANativeActivity pointer.

func (*Activity) Finish

func (h *Activity) Finish()

Finish calls the underlying NDK function.

func (*Activity) HideSoftInput

func (h *Activity) HideSoftInput(flags uint32)

HideSoftInput calls the underlying NDK function.

func (*Activity) Pointer

func (h *Activity) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Activity) SetWindowFlags

func (h *Activity) SetWindowFlags(addFlags uint32, removeFlags uint32)

SetWindowFlags calls the underlying NDK function.

func (*Activity) SetWindowFormat

func (h *Activity) SetWindowFormat(format int32)

SetWindowFormat calls the underlying NDK function.

func (*Activity) ShowSoftInput

func (h *Activity) ShowSoftInput(flags uint32)

ShowSoftInput calls the underlying NDK function.

type Error

type Error int32

Error represents an NDK error code.

func (Error) Error

func (e Error) Error() string

type HideSoftInputFlags

type HideSoftInputFlags int32
const (
	ImplicitOnly HideSoftInputFlags = 1
	NotAlways    HideSoftInputFlags = 2
)

type LifecycleCallbacks

type LifecycleCallbacks struct {
	OnCreate                   func(*Activity)
	OnStart                    func(*Activity)
	OnResume                   func(*Activity)
	OnSaveInstanceState        func(*Activity, unsafe.Pointer)
	OnPause                    func(*Activity)
	OnStop                     func(*Activity)
	OnDestroy                  func(*Activity)
	OnWindowFocusChanged       func(*Activity, int32)
	OnNativeWindowCreated      func(*Activity, unsafe.Pointer)
	OnNativeWindowResized      func(*Activity, unsafe.Pointer)
	OnNativeWindowRedrawNeeded func(*Activity, unsafe.Pointer)
	OnNativeWindowDestroyed    func(*Activity, unsafe.Pointer)
	OnInputQueueCreated        func(*Activity, unsafe.Pointer)
	OnInputQueueDestroyed      func(*Activity, unsafe.Pointer)
	OnContentRectChanged       func(*Activity, unsafe.Pointer)
	OnConfigurationChanged     func(*Activity)
	OnLowMemory                func(*Activity)
}

LifecycleCallbacks holds Go callbacks for ANativeActivity lifecycle events.

type NativeActivityCallbacks

type NativeActivityCallbacks struct {
	// contains filtered or unexported fields
}

NativeActivityCallbacks wraps the NDK ANativeActivityCallbacks handle.

func NewNativeActivityCallbacksFromPointer

func NewNativeActivityCallbacksFromPointer(ptr unsafe.Pointer) *NativeActivityCallbacks

NewNativeActivityCallbacksFromPointer wraps a raw ANativeActivityCallbacks pointer.

func (*NativeActivityCallbacks) Pointer

func (h *NativeActivityCallbacks) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type ShowSoftInputFlags

type ShowSoftInputFlags int32
const (
	Implicit ShowSoftInputFlags = 1
	Forced   ShowSoftInputFlags = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL