Manual     Reference     Scripting  
  
Scripting > Runtime Classes > AndroidJavaObject   
  • Menu
  • Overview
  • Runtime Classes
  • Attributes
  • Enumerations
  • Editor Classes
  • Attributes
  • Enumerations
  • History
  • Index
  • AndroidJavaObject
  • All Members
  • Constructors
  • AndroidJavaObject
  • Functions
  • Call
  • CallStatic
  • Dispose
  • Get
  • GetRawClass
  • GetRawObject
  • GetStatic
  • Set
  • SetStatic

AndroidJavaObject.Set  

function Set.<FieldType> (fieldName : String, val : FieldType) : void

Parameters

NameDescription
fieldName The name of the field (e.g. int counter; would have fieldName = "counter")
val The value to assign to the field. It has to match the field type.

Description

Set the value of a field in an object (non-static).

The generic parameter determines the field type.

// Create a android.text.format.Time object, and set the 'allDay' field to true.
function Start() {
var jo = new AndroidJavaObject("android.text.format.Time");
var valueString = jo.Set.<bool>("allDay", true);
}