Lynxbee topic

Java

Articles about Java.

Fix RecyclerView Orientation WrongConstant

`WrongConstant` is Android lint telling you that an integer came from outside the API’s documented constant set. Use the constant family declared by the parameter, then investigate dependency or lint-version drift if an official alias is still flagged.

Fix ContextImpl Cannot Be Cast to Activity

`Context` is a capability family, not another name for `Activity`. Find the failing cast, decide whether the operation truly needs a UI owner, and change the API contract instead of swapping context methods until the crash disappears.

Prevent Screenshots in Android with FLAG_SECURE

`FLAG_SECURE` asks Android to keep a window out of screenshots and non-secure displays. Apply it before sensitive UI appears, understand its window-wide scope, and treat newer detection and screen-share APIs as complementary—not interchangeable—controls.

Fix “Invoke-customs” Android min-api 26 Build Error

This dex error usually means a module or dependency emits Java 8 invocation bytecode without compatible desugaring. First configure the module correctly; if the failing code calls MethodHandle.invoke, use the API-26-safe path instead of masking the problem.

Call C from Java with JNI on Linux

This modern JNI example replaces removed `javah` instructions with `javac -h`, derives the active JDK include path, compiles position-independent C into a shared library, and verifies both the exported symbol and Java-to-native call.

Engineering weekly

Useful technical knowledge, not inbox noise.

Receive verified fixes, references, labs, and tools. Confirm by email; unsubscribe any time.