Swipe among activities in android

那年仲夏 提交于 2019-12-04 13:36:19

问题


i have 4 activities in which i have to swipe them right, left and if i am in last activity and swipe to the left then again first activity should be shown.

can anybody have any idea how i can achieve this? or some sample code?

thanks a lot.


回答1:


you can achieve it by animaton.. But it will show as a Gallery view and you can swipe as well... OnTouchEvent on every activity you can call another activity using intents by overridePendingTransition(R.anim.act_back_slide_enter, R.anim.act_back_slide_leave);

//overridePendingTransition("animation for activity which enters", "animation for activity which leaves");

I have not yet tried this... but we can make it in this form.. If you get success let me know.




回答2:


@sajjoo Here goes your answer in deezapps widget with the questions below pointing at it

  • How to show multiple screens with right/left slide Gesture
  • How to create a slider screen (As in Tweetdeck) in Android?

and many more linked questions..




回答3:


I recently posted a question that covers a lot of this (my question is about using Swipe together with ScrollView, the Swipe gesture by itself works just fine):

Swipe/Fling tab-changing in conjunction with ScrollView?

If you read the sources I have listed and use the code I've provided then you should be able to do it.




回答4:


It's work fine... just must to delete the redundant R.java file...!

http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/



来源:https://stackoverflow.com/questions/5105380/swipe-among-activities-in-android

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