Hello developers in this generation much more apps have sliding menus. in this type menu just swipe left or right and open your target page…

To create this type menu add simple code to detect swipe and get instruction data from user swipe and throw out result. Please see below the code for swipe detection and perform after detect


linear_id.setOnTouchListener(new View.OnTouchListener() {@Override public boolean onTouch(View p1, MotionEvent p2){ switch(p2.getAction()) { case MotionEvent.ACTION_DOWN: f = p2.getX();break; case MotionEvent.ACTION_UP: t = p2.getX();if (((f - t) < -250)) {_slideLeft();} if (((t - f) < -250)) {_slideRight();}break;}return true;}});