PointerToJObject

Typehandler
DictionaryLCB
LibraryLiveCode Builder
Syntax
PointerToJObject(<pPointer>)
Associationscom.livecode.java
Summary

Convert a Pointer into a JObject

Parameters
NameTypeDescription
pPointer

The Pointer to convert

Example
foreign handler _JNI_SetTextViewText(in pView as JObject, in pValue as JString) returns nothing binds to "java:android.widget.TextView>setText(Ljava/lang/CharSequence;)V"

-- set the text of a view
unsafe handler ViewSetText(in pString as String)
	variable tViewPtr as Pointer
	put my native layer into tPointer

	variable tView as JObject
	put PointerToJObject into tView
	_JNI_SetTextViewText(tView, StringToJString(pString))
end handler
Values
NameTypeDescription
return

A JObject wrapping the jobject Pointer

Description

Use PointerToJObject to convert a variable of type Pointer to one of type JObject.

Important: Your application will likely crash if the underlying type of the Pointer is not actually jobject.