I had built an app like ImageSwitcher in the APIDEMO. In the demo, if
you fling the gallery, it will call the onitemselected() function
every image that you fling over. now i want to realize that it will
only call the onitemselected() function at the end of flinging, not
the first and the end image being flinged. i written the code like
this:

public void onCreate(Bundle savedInstanceState) {
Gallery g = (Gallery) findViewById(R.id.gallery);
        g.setFadingEdgeLength(100);
        g.setAdapter(new ImageAdapter(this));
        g.setOnItemSelectedListener(this);
        g.setCallbackDuringFling(false);
    }
public void onItemSelected(AdapterView parent, View v, final int
position, long id) {
        mSwitcher.setImageResource(mImageIds[position]);
}

i use setCallbackDuringFling(false) to controll this, but it failed,
the onitemselected() function still being called more than once. why?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to