4

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.

sajjoo
  • 6,576
  • 20
  • 65
  • 86

4 Answers4

2

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.

fargath
  • 7,844
  • 6
  • 24
  • 36
  • 1
    yep i have implemented onGesterListner and onNewIntent() and i have set the launch mode of the activities to "single instance". so these activities has the single instance and on next and previous button i call the specific activity by sending intent and in my callee activity onNewIntent() method gets fired instead of onCreate. if you need my code i can send it to you aswell. – sajjoo Mar 01 '11 at 09:50
2

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

and many more linked questions..

Community
  • 1
  • 1
100rabh
  • 6,156
  • 5
  • 27
  • 41
  • here in deezapps sample he is swiping views not activities. i need to swipe among activities. – sajjoo Feb 24 '11 at 14:44
  • @sajjoo then give try to [ActivityGroup](http://stackoverflow.com/questions/4568468/activitygroup-example/4734984#4734984) – 100rabh Feb 24 '11 at 14:52
0

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.

Community
  • 1
  • 1
Codemonkey
  • 3,412
  • 3
  • 20
  • 24
-1

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/