yes it fails when one element is in stack and says stack empty
–
engineer41Jan 17 '13 at 9:40

im actually implementing it behind the back button in fileExplorer....now when do what u says ..it skips two steps ....
–
engineer41Jan 17 '13 at 9:42

@engineer41 - Pop will only remove one element. Note that you are popping twice, saving the second value in open - when you Pop it removes from the stack - did you expect it to remain there?
–
Oded♦Jan 17 '13 at 9:43

this code is removing 0 and 2 element ...i expect it to only remove one item and show the rest
–
engineer41Jan 17 '13 at 9:47