hi sir
Hi I am using gallary layout my application is running when gallary moving from left ti right it is infinite that means elements are repeated again,Here is no problem,But when we move from right to left i am reached the first position after then no elements are coming.But i want to repeat elemts from this side also.Give me some suggestions
Gallery g = (Gallery) findViewById(R.id.gallery);
g.setAdapter(new ImageAdapter(this));
g.setFocusable(true);
g.setSelection((int)(Integer.MAX_VALUE / 2) - (Integer.MAX_VALUE / 2)% mImageIds.length);
g.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id)
{
try {
imageid=position;
((ImageView)findViewById(R.id.ImageViewlarge)).setImageResource(mImageIds[position]);
((TextView)findViewById(R.id.TextViewImageName)).setText(imgNames[position]);
mp = MediaPlayer.create(SeaSpell.this,audioTrack[position]);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
@Override
protected void onStart() {
super.onStart();
imageid=getSharedPreferences("ResultInfo", 0).getInt("Result", 0);
Log.v("Gallary","Imageid"+imageid);
isUpdateUI = true;
mRedrawHandler.handleMessage(new Message());
}
@Override
protected void onPause()
{
super.onPause();
isUpdateUI = false;
}
class RefreshHandler extends Handler {
@Override
public void handleMessage(Message msg) {
SeaSpell.this.updateUI();
}
public void sleep(long delayMillis) {
this.removeMessages(0);
if(isUpdateUI)
sendMessageDelayed(obtainMessage(0), delayMillis);
}
}
public void updateUI(){
try
{
getImages();
mRedrawHandler.sleep(3000);
}
catch (Exception e) {
e.printStackTrace();
}
}
private void getImages()
{
if(imageid>=22)
imageid=0;
//((Gallery) findViewById(R.id.gallery));
((ImageView)findViewById(R.id.ImageViewlarge)).setImageResource(mImageIds[imageid]);
((TextView)findViewById(R.id.TextViewImageName)).setText(imgNames[imageid]);
imageid++;
}
screenshot frontgallery http://www.freeimagehosting.net/image.php?d816500473.png how can i make gallery view as circular.i am able to done left to right infinite when i drag right to left.it is showing end point i am new in android give me some suggestion