The method
createExtensionContext()
takes
a String parameter that is the context type for the new extension
context. This string specifies more information about what the new
extension context is to do.
For example, suppose the extension com.example.TVControllerExtension
can manipulate both channel and volume settings. Passing
"channel"
or
"volume"
in
createExtensionContext()
indicates
which functionality the new extension context will be used for.
Another ActionScript class in the extension, such as TVVolumeController,
could call
createExtensionContext()
with
"volume"
for
the
contextType
value. The native implementation
uses the contextType value in its context initialization.
Typically, each possible context type value you define corresponds
to a different set of methods in your native implementation. The
context type, therefore, corresponds to what is, in effect, a class
in your native implementation. If you call
createExtensionContext()
multiple
times with the same context type, typically your native implementation
creates multiple instances of a particular native class.
When the context types of multiple calls to
createExtensionContext()
are
different, the native side typically performs different initializations.
Depending on the context type, the native side can create an instance
of a different native class and can provide a different set of native
functions.
Note:
A simple extension often has only one context type. That is,
it has only one set of methods in the native implementation. In
this simple case, the context type String parameter can be
Null
.