Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. public class IconListViewAdapter extends ArrayAdapter<Genres> {
  2.     @Override
  3.     public View getView(int position, View convertView, ViewGroup parent) {
  4.         Button buttonGo = null;
  5.                    
  6.         View mainView = null;
  7.         LayoutInflater mainViewInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  8.         mainView = mainViewInflater.inflate(R.layout.main, null);
  9.    
  10.         buttonGo = (Button) mainView.findViewById(R.id.buttonGo);                          
  11.                            
  12.         if (this.selectedPos == position) {
  13.             buttonGo.setBackgroundResource(R.drawable.go);
  14.         }
  15.         else {
  16.             buttonGo.setBackgroundResource(R.drawable.gone);       
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement