android: avoid NPE accessing invalid tab index.