Crash when clicking on table row - Android Device only?...

You must Login before you can answer or comment on any questions.

Hi,

Not sure at all why this is happening...when I click on a row in my table view, a second later the app comes up with a message box saying it needs to close?

This is some of the code where the bug could be:

for (var i = 0; i < amount; i++) 
                {  
                    var url = parsedData.data[i].images.standard_resolution.url;  // holds image
 
                    var row = Ti.UI.createTableViewRow({height:'100dp', imageURL:url});
                    row.backgroundColor = '#576996';
 
 
                    var instagramPhoto = Ti.UI.createImageView({
                        image:url,
                        top: 0,
                        left: 0,
                        width:'100',
                        height:'100',
                    });
 
                    row.add(instagramPhoto);
 
                    data[i] = row;
                }       
                var tableview = Titanium.UI.createTableView({data:data, top:'80dp', width:'300dp',
                height:'300dp'});
                mainView.add(tableview);
 
                            tableview.addEventListener('click', function(e)
                {
                    var im = e.source.toImage();// toBlob();
                    apiData.selectedImage = im;   
                });
The above is fine on iOS. The crash I believe is on the click event, the line e.source.toImage...but why?

Thanks

— asked 8 months ago by steve green
1 Comment
  • Ok, seem to have fixed the issue.

    Have to use:

    apiData.selectImage = e.row.imageURL;
    On iPhone I used rowData, why different on Android?!

    — commented 8 months ago by steve green

Your Answer

Think you can help? Login to answer this question!