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 8270733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:40:26+00:00 2026-06-08T06:40:26+00:00

I have used both Gallery and ViewPager widgets, I am fetching images from web

  • 0

I have used both Gallery and ViewPager widgets, I am fetching images from web service,
but I couldn’t place them in the ViewPager, but in Gallery it is easy.
I used this tutorial for ViewPager
http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-horizontal-view-paging/

I want android Gallery widget scroll like the ViewPager scroll,

is this possible, how can I do this.

  • 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-06-08T06:40:29+00:00Added an answer on June 8, 2026 at 6:40 am

    Here is a bare bones example of the instantiateItem() method for your PagerAdapter that would fill it with image views dynamically.

    @Override
    public Object instantiateItem( final View pager, final int position )
    {
        //Note: if you do not have a local reference to the context make one and
        //set it to the context that gets passed in to the constructor.
        //Another option might be to use pager.getContext() which is how its
        //done in the tutorial that you linked.
        ImageView mImg = new ImageView(context);
    
        /*Code to dynamically set your image goes here.
        Exactly what it will be is going to depend on 
        how your images are stored. 
        In this example it would be if the images
        are on the SD card and have filenames
        with incrementing numbers like: (img0.png, img1.png, img2.png etc...)*/
    
        Bitmap mBitmap = BitmapFactory.decodeFile(
             Environment.getExternalStorageDirectory() + "/img" + position + ".png");
        mImg.setImageBitmap(mBitmap);
    
    
    
    
        ((ViewPager) collection).addView(mImg, 0);
        return mImg;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used both, and I conclude that I can read html data from
I find have used both these functions before, but I don't quite see the
I have zero experience in Javascript and JQuery but I have used both in
I have used both SQL and LDAP, but in a recent conversation with one
I want to call an external program from Python. I have used both Popen()
I have used gallery in my app. In that i have two images in
I have used both but what I am not clear is when I should
I have used the using statement in both C# and VB. I agree with
I have a silly, little class FileSystemSize which can be used both as an
I have created a form that is used for both adding and editing a

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.