Search code examples
androidandroid-activityswipe-gesture

Android: Is it possible to Swipe between two Activities?


I want to swipe between two activities (NOT FRAGMENT ) both activities are extended from ActionBarACtivity , so it is possible or not ? If possible then how it will done?


Solution

  • You are extending an activity does not meant that they are related in the screen or window, activity class is an abstraction or a class where you can put your logic into. Since Every activity is attached to a single window, sure it is possible. Look at libraries like this, it will provide you easy helper function to implement this, or read the code to customise it ;)

    Since this involves lots of code, you can also look at this or sliding activity for getting an idea of implementing it ;)

    NOTE: only way to do is start second activity & then control its visibility