{ "id": "172748", "key": "TIMOB-26654", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-05-01T23:04:25.000+0000", "created": "2018-12-14T12:47:59.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-05-01T23:04:42.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Hello!\r\nHow to get access the views in the inflate layout on android hyperloop? We have a button in inflate layout and we want to set button text form our js file.\r\n\r\nTest code :\r\n{code}\r\nvar window = Titanium.UI.createWindow();\r\n\r\nvar OnValueChangeListener = require('android.widget.NumberPicker.OnValueChangeListener');\r\nvar OnClickListener = require('android.view.View.OnClickListener');\r\nvar Activity = require('android.app.Activity');\r\nvar Button = require('android.widget.Button');\r\nvar Context = require('android.content.Context');\r\nvar LinearLayout = require(\"android.widget.LinearLayout\");\r\nvar Inflater = require('android.view.LayoutInflater');\r\n// var numberOnclickListener =\r\n// require('android.content.NumberPicker.OnClickListener');\r\n\r\nvar activity = new Activity(Ti.Android.currentActivity);\r\nvar layout = new LinearLayout(activity);\r\n\r\nvar viewLayout = new LinearLayout(activity);\r\n\r\nvar okButton = new Button(activity);\r\n// var field = new Field();\r\nvar cancelButton = new Button(activity);\r\n\r\nvar inflater = Inflater.cast(activity.getApplicationContext().getSystemService(\r\n\t\tContext.LAYOUT_INFLATER_SERVICE));\r\n\r\nvar resId = activity.getResources().getIdentifier('button', 'layout',\r\n\t\tactivity.getPackageName());\r\nvar view = inflater.inflate(resId, null);\r\n// numberPicker1 = activity.getResources().getIdentifier(\"button\", \"id\",\r\n// activity.getPackageName());\r\n// numberPicker1.setMinValue(1);\r\n// numberPicker1.setMaxValue(9);\r\nvar resid = Titanium.App.Android.R.id.cancelButtton;\r\n// var id =\r\n// Ti.Android.currentActivity.getIdentifier(Ti.Android.R.cancelButtton);\r\nvar myButton = new Button(view.findViewById(resid));\r\nmyButton.setText(\"Hello!\");\r\nwindow.add(view);\r\n\r\nwindow.open();\r\n{code} \r\nPlace it to the [app]/platform/android/res/layout/\r\n{code:xml}\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t