Seems like there was no problem with the code....but the problem was with the view,the xml file..
the linear layout was not filling the whole space...so the only swipe which was working was the bottom swipe...and that too only in the top region.(where the linear layout existed)......