diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java index a4d35f234a3..97d81da263e 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java @@ -6,6 +6,7 @@ */ package ti.modules.titanium.ui.widget.tabgroup; +import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.common.Log; import org.appcelerator.titanium.TiBaseActivity; import org.appcelerator.titanium.TiC; @@ -412,6 +413,17 @@ public void onTabUnselected(TabLayout.Tab tab) @Override public void onTabReselected(TabLayout.Tab tab) { + if (tab != null) { + int index = tab.getPosition(); + if ((index >= 0) && (index < this.tabs.size())) { + TiViewProxy tabProxy = this.tabs.get(index).getProxy(); + if (tabProxy != null && tabProxy.hasListeners(TiC.EVENT_SELECTED)) { + KrollDict data = new KrollDict(); + data.put("index", index); + tabProxy.fireEvent(TiC.EVENT_SELECTED, data, false); + } + } + } } public void setTabMode(int value)