Android gallery onselecteditem

Discussion in 'Application Development' started by faisalloe, Jun 22, 2010.

  1. faisalloe

    faisalloe Member
    15

    Jan 21, 2010
    17
    0
    15
    I am using gallery widget i want to change selected image.

    Code (Text):
    1. @Override
    2.     public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
    3.     if(lastSeen != null){
    4.        lastSeen.setImageResource(unselected image);
    5.     }
    6.  
    7.     (ImageView(view)).setImageResource(selected image)
    8.     lastSeen = view;
    9. }

    When i run the following code and i use roller ball or arrow keys over device and if i try to scroll left to right or right to left focus goes out of gallery to next item over the screen what is that ?
     

    Advertisement

Share This Page

Loading...