Table View for android in Titanium

The following code will create a table view of countries and also added event listener to handle click.

Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();

var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});

var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Table View',
window:win1
});

var dataSource =     [{title:"India"},
{title:"China"},
{title:"United States"},
{title:"Japan"},
{title:"Australlia"},
{title:"England"},
{title:"France"},
{title:"Germany"},
{title:"Italy"},
{title:"Switzerland"},
{title:"Sweden"},
{title:"Brazil"},
];
var table = Titanium.UI.createTableView({data: dataSource});
table.addEventListener('click', function(e){
switch(e.index){
case 0:
alert("India");
break;
case 1:
alert("China");
break;
case 2:
alert("United States");
break;
case 3:
alert("Japan");
break;
case 4:
alert("Australlia");
break;
case 5:
alert("England");
break;
case 6:
alert("France");
break;
case 7:
alert("Germany");
break;
case 8:
alert("Italy");
break;
case 9:
alert("Switzerland");
break;
case 10:
alert("Sweden");
break;
case 11:
alert("Brazil");
break;
}
});
win1.add(table);

tabGroup.addTab(tab1);

tabGroup.open();