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);
Although this is an old question, I had the same problem and maybe it helps others. This was the crucial part of my Adapter:
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