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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:26:53+00:00 2026-06-02T18:26:53+00:00

I am new to android and I am working in an application that want

  • 0

I am new to android and I am working in an application that want to swipe my layouts. Is it possible to bind layouts to android widget Gallery. Or please advice me the best practice to swipe my layouts in android.

Please help me with a valid link if possible

Thanks in advance.

My main class

public class GalleryTestActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Gallery gallery = (Gallery) findViewById(R.id.gallery);
        gallery.setAdapter(new ImageAdapter(this));


}
}

My base class

public class ImageAdapter extends BaseAdapter {
    int mGalleryItemBackground;
    private Activity mContext;
    private Gallery mGallery; 


    private Integer[] mImageIds = {
            R.layout.instruction,
            R.layout.instruction2

    };

    public ImageAdapter(Activity c)
    {
        mContext=c;
        TypedArray attr = mContext.obtainStyledAttributes(R.styleable.HelloGal999lery);
        mGalleryItemBackground = attr.getResourceId(
                R.styleable.HelloGal999lery_android_galleryItemBackground, 100);
        attr.recycle();
    }



    public int getCount() {
        return mImageIds.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
            //Help me here
        View rowView = convertView;
        if(rowView==null)
        {
            LayoutInflater inflater = mContext.getLayoutInflater();
             rowView = inflater.inflate(mImageIds[position], null, true);
        }
        return rowView;

    }
}
  • 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-02T18:26:55+00:00Added an answer on June 2, 2026 at 6:26 pm

    You may use Gallery.

    or there is new widget ViewPager in android support package.

    Here is nice tutorial about ViewPager

    This is also a good repository about ViewPager usage.

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

Sidebar

Related Questions

I'm new to Android development and working on an Android application that requires the
I am working android application that required login, Now I want After successfully login
Hi I'm new to android world.Iam working on an application that supports multiple screen
I'm new to android developing but right now I'm working on an application that
I am working on the android application that required login. I want to check
I am new to android and working on accelerometer. I want to collect 20
I am a new android developer. Currently I am working on an application which
I have created one native application in android that is working fine. This application
I'm working on an android application, and I have a drawable that I'm loading
I'm currently working on an application in Android. As a start, I want to

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.