public void setCurrentTabToFocusedTab() { View tab = null; int index = -1; final int count = getTabCount(); for (int i = 0; i < count; ++i) { View v = getChildTabViewAt(i); if (v.hasFocus()) { tab = v; index = i; break; } } if (index > -1) { super.setCurrentTab(index); super.onFocusChange(tab, true); } }
public void superOnFocusChange(View v, boolean hasFocus) { super.onFocusChange(v, hasFocus); }