I've adapted the code from 
this<http://developer.android.com/guide/topics/ui/layout/gridview.html>android 
developer link to change an image when clicked on.  I would now 
like to know how i can change an adjacent image (or any other image in the 
gridview), by position index.  Thanks!


gridview.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View v, int 
position, long id) {
                ImageView imageView = (ImageView) v;
                imageView.setImageResource(R.drawable.image1);
                
                // TODO: set image at grid index *position-1* (it is 
understood that boundary checking is required)
        }
});

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to