Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17541] Android: AlertDialog has no method 'setAndroidView'

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2014-09-22T22:08:09.000+0000
Affected Version/sRelease 3.2.3, Release 3.3.0
Fix Version/sn/a
ComponentsAndroid
LabelsTCSupport, supportTeam
ReporterManuel Lehner
AssigneeGary Mathews
Created2014-08-04T11:16:56.000+0000
Updated2017-03-16T22:18:51.000+0000

Description

Problem Description

Can't set the androidView property of Ti.UI.AlertDialog after creation. setAndroidView is a documented method. http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.AlertDialog-method-setAndroidView

Steps to reproduce

1. Create a simple project. 2.. Paste the testcase into app.js:
var ad = Ti.UI.createAlertDialog();
var av = Ti.UI.createView();
ad.setAndroidView(av);
3.Run on Android

Expected Result

The app should work.

Actual Result

throws Titanium Javascript Runtime Error: {color:red} Message: Uncaught TypeError: Object # has no method 'setAndroidView' {color}

Comments

  1. jithinpv 2014-08-22

    Issue reproduces Titanium SDK version 3.4.0 master, 3.3.0.GA, 3.2.3.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Nexus 5, Android version : 4.4.4
  2. Gary Mathews 2014-09-22

    setAndroidView gets generated by the documentation even though it doesn't exist. The androidView can still be set :
       var ad = Ti.UI.createAlertDialog();
       var av = Ti.UI.createView();
       ad.androidView = av;
       
    So removing setAndroidView from the documentation rather than implement the setter is probably the best option. PR : https://github.com/appcelerator/titanium_mobile/pull/6154
  3. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source