move activity to another activity using Finger

℡╲_俬逩灬. 提交于 2019-12-12 05:27:43

问题


In my app, I want that using finger movement from left-to-right in Activity A should call Activity B. Similarly, if i move it right-to-left, it should go back to the previous Activity, i.e, Activity A.

How to achieve this?


回答1:


you have to define your gestures with the android gesture tool then you have to implement a gesture listener to listen for gesture events

Basic Gesture Detection - stackoverflow

Introduction to Gestures - mobile tuts


Source: Android: Slide gesture and animation for switching between tabs




回答2:


Well there are several ways to achieve what you're talking about.

You could use the gesture builder to listen for a swipe and then fire your intents to start the activity.

Without knowing more, you may also want to look at page viewer.



来源:https://stackoverflow.com/questions/13501935/move-activity-to-another-activity-using-finger

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!