johannilsson/android-actionbar — Issue #45: Crash if press "Remove action" when no button in ActionBar
Author: anticafe
Created: 2011-12-30 09:07:05+00:00
State: open

At first launch, I see there are 2 buttons in ActionBar.
I try to press "Remove Action" many times (> 2 times) and get a crash.

I found maybe because of OutOfBound exception in actionBar.removeActionAt(actionCount - 1);
removeAction.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
int actionCount = actionBar.getActionCount();
actionBar.removeActionAt(actionCount - 1);
Toast.makeText(HomeActivity.this, "Removed action." , Toast.LENGTH_SHORT).show();
}
});
You should check if there is any button in ActionBar before remove it.

Cheers,
Btw, it's a great library. Thank your very much for your hard-working ;)