[TIMOB-23551] Hyperloop: Android - Objects should have have a `className` parameter
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | High |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2017-11-09T19:25:16.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Hyperloop |
| Labels | n/a |
| Reporter | Bert Grantges |
| Assignee | Jan Vennemann |
| Created | 2016-06-23T00:44:52.000+0000 |
| Updated | 2018-08-06T17:37:02.000+0000 |
Description
There should be a way to determine the type of a Hyperloop Object in order to type check it if needed. This could be done using the
.apiName concept used in Titanium or perhaps a className property on the object.
This may already exist, can we confirm that the function
isInstanceOfreturns the expected ClassName?Already implemented via the
instanceofoperator.ar Activity = require('android.app.Activity'); var Context = require('android.content.Context'); var View = require('android.view.View'); var currentActivity = new Activity(Ti.Android.currentActivity); console.log(currentActivity instanceof Activity); // Prints true console.log(currentActivity instanceof Context); // Prints true console.log(currentActivity instanceof View); // Prints falseClosing as invalid. If incorrect, please reopen.