Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6889473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:09:38+00:00 2026-05-27T06:09:38+00:00

In looking at the ApiDemos example in the Android (1.5) SDK, there is a

  • 0

In looking at the ApiDemos example in the Android (1.5) SDK, there is a fine example of using an ImageSwitcher, with a Gallery object to provide the “change image” actions.

The application I’m looking to write, starting into Android development, has three images that I want to be able to pane/scroll through, so ImageSwitcher looks like a fine solution. However, I don’t [necesarily] want to have thumbnails in a gallery. I want either a swipe action, and/or a button, to cause a scroll to the previous/next image in the set.

The example ImageSwitcher in ApiDemos uses a Gallery, and without that Gallery, doesn’t do anything.

If someone has a suggestion of a way to bind some sort of button controller, or a U/I swipe object, I would appreciate the pointer.

Sorry to ask such a newbie level question.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:09:39+00:00Added an answer on May 27, 2026 at 6:09 am

    You can use it like this:

      public class GalleryActivity extends Activity implements ViewFactory{    
        /** Called when the activity is first created. */
            @Override
            public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.gallery);        
    
            iSwitcher = (ImageSwitcher) findViewById(R.id.imageSwitcher1);
            iSwitcher.setFactory(this);
            iSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,
                    android.R.anim.fade_in));
            iSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,
                    android.R.anim.fade_out));
    
            iSwitcher.setImageDrawable(fetchImage(mImageURLS[0]));
    
            iSwitcher.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {
                    // CLICK HANDLER
                    // Change image like: 
                    // iSwitcher.setImageDrawable(fetchImage(mImageURLS[1]));
                }
            });
       }
    
        @Override
        public View makeView() {
            ImageView iView = new ImageView(this);
            iView.setScaleType(ImageView.ScaleType.FIT_CENTER);
            iView.setLayoutParams(new 
                    ImageSwitcher.LayoutParams(
                            LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
            iView.setBackgroundColor(0xFF000000);
            return iView;
        }
    }
    

    fetchImage(mImageURLS[0]) returns Drawable object

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have ran the sample app here: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html I can't, however, figure out
Looking for an example that: Launches an EXE Waits for the EXE to finish.
Looking at the processmodel element in the Web.Config there are two attributes. maxWorkerThreads=25 maxIoThreads=25
Looking for a good rss/feed reader for windows or if there are any good
Looking for a general case solution to determine if any jquery dialog (there are
Looking at all the examples of Operational Transformation Frameworks out there, they all seem
Looking at the Apple iPhone Core Data Recipes sample app, they store image files
Looking for web service that download a webpage (we'll provide the URL), normalize it
looking for a large file upload solution on MVC3. There's a few examples in
I am trying to learn how to read the SMS outbox on Android. There

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.