Is it possible to create a click event using the status bar icon
You need to add a callback to the onHomeIconItemSelected
property. Say you have a Tabgroup
with a "tabGroup" id, it would be something like:
$.tabGroup.addEventListener('open', function(e) {
var activity = $.tabGroup.activity;
// Avoid older APIs executing this code
if( Ti.Platform.Android.API_LEVEL >= 11 ) {
activity.actionBar.onHomeIconItemSelected = function() {
alert("Home icon clicked!");
};
}
}
For a more complete and detailed explanation, you could refer to https://github.com/websterj/Alloy2TabbedAndroidUI which is a good demonstration of an app using the Action Bar in Titanium.