Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1949] Android: Person returned by showContacts always has null image (Android 2.0 and higher)

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:57:37.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsAndroid
Labelsandroid, defect, rplist
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:06:19.000+0000
Updated2011-04-17T01:57:37.000+0000

Description

Even if a person has an image (photo), if that person is retrieved via the showContacts API (the contacts picker), its image property will return null, as opposed to a person retrieved via getAllPeople, for example. This occurs only on phones supporting the new contacts api, so phones with 2.0 or higher.

Failcase app.js

Titanium.UI.setBackgroundColor('#000');
var w = Titanium.UI.createWindow({  
    title:'Test',
    backgroundColor:'#fff'
});

var btn = Ti.UI.createButton({
    title: 'Show Contacts Picker'
});

btn.addEventListener('click', function(){
    Ti.Contacts.showContacts( {
        selectedPerson: function(e) {
            var img = e.person.image;
            if (img === null) {
                alert('Image is null');
            } else {
                alert('Image is not null');
            }
        }
    })
});
w.add(btn);
w.open();

If you run that failcase and select a contact with a photo, it will still say "Image is null". Expected: "Image is not null."

Comments

  1. Bill Dawson 2011-04-15

    (from [fc78d2977d6595b8d54dadac3a8b1024a3af43d9]) [#1949 state:fixed-in-qa] Correctly indicate if a person has a photo when that person is loaded directly from a cursor based on the people projection http://github.com/appcelerator/titanium_mobile/commit/fc78d2977d6595b8d54dadac3a8b1024a3af43d9"> http://github.com/appcelerator/titanium_mobile/commit/fc78d2977d659...

  2. Bill Dawson 2011-04-15

    (from [901074850fdc4e2ee26a378936074271ce5c4970]) [#1949 state:fixed-in-qa] Correctly indicate if a person has a photo when that person is loaded directly from a cursor based on the people projection http://github.com/appcelerator/titanium_mobile/commit/901074850fdc4e2ee26a378936074271ce5c4970"> http://github.com/appcelerator/titanium_mobile/commit/901074850fdc4...

  3. Thomas Huelbert 2011-04-15

    1.4.2.5935b3 G1 and 2.2sim

JSON Source