Code example for Stack

Methods: pop, size

0
    } 
     
    @Override 
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            int size = mIds.size();
            if (size > 0) {
                String topId = mIds.pop();
                View view = mActivityManager.destroyActivity(topId, true).getDecorView();
                mAnimator.removeView(view);
                if (size > 1) {
                    return true; 
                } 
            } 
        } 
        return super.onKeyDown(keyCode, event);
    } 
     
     
     
 /*