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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:01:23+00:00 2026-05-28T01:01:23+00:00

I have an android application with a gallery that switches between textswitcher views. It

  • 0

I have an android application with a gallery that switches between textswitcher views. It always starts in between two textswitcher views. Why does this happen? I’m setting the selection to a specific position.

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
g = (Gallery) findViewById(R.id.gallery);
g.setAnimationDuration(200);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    g.setAdapter(hello);
    g.setSpacing(20);
    g.setSelection(2);
  • 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-28T01:01:23+00:00Added an answer on May 28, 2026 at 1:01 am

    Although this is an old question, I had the same problem and maybe it helps others. This was the crucial part of my Adapter:

        public View getView(int position, View convertView, ViewGroup parent) {
    
            Display display = ((WindowManager) c.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
            int width = display.getWidth();
    
            LayoutInflater inflater = LayoutInflater.from(c);
            View view = inflater.inflate(R.layout.date_list_item, parent,false);
            view.setLayoutParams(new Gallery.LayoutParams(width/3, Gallery.LayoutParams.MATCH_PARENT));
    

    I wanted to have three items shown at the same time, so I took parent.getWidth()/3. however this led the gallery to start between two views. Getting the displays width shown in the upper code-sample worked fine for me

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

Sidebar

Related Questions

I have a Web Service and an Android application that uses this web service.
I have an Android application that connects to Facebook to request authorization of an
I have two threads in an Android application, one is the view thread, and
I have android application that I need to debug using eclipse. When I right
I have an Android application that generates some HTML which is rendered locally, in
I have an android application acessing an webservice that returns a big result. The
I have an android application that gets invoked through ADB on a desktop machine.
I have an android application that pulls a list of videos stored in an
I have noticed that some Android applications adds a new Wallpaper-gallery to the Wallpaper-chooser.
I have an Android application that uses tabs. I already have the tabs, and

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.