Ofir A.
Ofir A.

Reputation: 3162

Horizontal scrolling between activities in Android

I'm building a new application to the Android platform and I want to implement moving between different activities by scrolling. I want also to use some kind of scrolling effect like in this example.

I've searched the web and found a couple of examples using view pager and fragments, but my problems are:

  1. View pager is used to switch between views and I want to switch between different activities.
  2. I don't want to use fragments because I don't think it's going to fit to earlier API (before Android 2.1).

So, for my questions:

  1. Is there any other way for doing it, except of using onFling gesture and then losing the sliding effect?
  2. Can I use fragments to the earlier API's?

Thanks.

Upvotes: 1

Views: 3914

Answers (2)

Jeje Doudou
Jeje Doudou

Reputation: 1706

You can use fragments in earlier versions, using android-support-v4. If you work with Eclipse, you can add it to your project by right-click on it, "Android Tools", then "Add Support Library... "

Upvotes: 1

Andro Selva
Andro Selva

Reputation: 54330

Of course it is possible to use fragments in lower versions. You simply have use the android support library and impost viewpager to your app. Here is a very good example which uses View Pager and fortunately it implements the support libraries and it worked for me from android 2.1.

http://viewpagerindicator.com/

Upvotes: 2

Related Questions