A sample code is here android-sliding-menu-demo which is found from one of the links mentioned in the answer from cosmix. I know it's the answer copied from another stack overflow thread only, but I still mentioned here so that users coming to this question got the direct link to the source code.