I have a gridview in which there are two elements in each of its items, the first is an image and the second is a title, the title is invisible in the launching of the application, but I have a button outside the grid view that when I click on it, I want to change the visibility of the titles of items to become visible, my problem is that I can not access each title of each item in the grid view. When I set the visibility of the titles (TextView) in the onClick method of the independent button in my activity, it changes the visibility ONLY for the FIRST item in the grid view!
This sketch represent my interface, so the titles are invisible in the beginning, but when i click on "SetVisibilityButton", i want to set them to Visible :
Image1 Image2 Image3
Title1 Title2 Title3
Image4 Image5 Image6
Title4 Title5 Title6
Image7 Image8 Image9
Title7 Title8 Title9
----------------------------
SetVisibilityButton
____________________________
I set the grid view in my oncreate() activity :
favorGrid = (GridView) findViewById(R.id.favorGrid);
favorGrid.setAdapter(adapter);
In my ImageAdapter class, this is my getView() method :
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
View MyView = convertView;
/*we define the view that will display on the grid*/
//Inflate the layout
LayoutInflater li = getLayoutInflater();
MyView = li.inflate(R.layout.favor_item, null);
// Add The Text!!!
TextView tv = (TextView)MyView.findViewById(R.id.title);
tv.setText(mTitles[position]);
// Add The Image!!!
ImageView iv = (ImageView)MyView.findViewById(R.id.favor_item_image);
iv.setImageResource(mT