Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. private void loadNextFlag() {
  2. /////////////////
  3. mInt=0;
  4. LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  5. // цикл выводит два LinearLayout
  6. for (int row = 0; row < 2; row++){
  7. LinearLayout linLayout = getTableRow(row);
  8. // Место Кнопки
  9. // в каждый LinearLayout добавляю три картинки
  10. for (int column = 0; column < 3; column++){
  11. ///////////
  12. // макет для каждой картинки
  13. View view = inflater.inflate(R.layout.guess_button, linLayout, false);
  14. mImageView = (ImageView) view.findViewById(R.id.imageView1);
  15. // вставляю картинку из массива по индексу mInt
  16. mImageView.setImageResource(persons.get(mInt).getPhotoId());
  17. linLayout.addView(view);
  18. // обработчик нажатие
  19. view.setOnClickListener(guessButtonListener);
  20. mInt=mInt+1;
  21. }
  22. }
  23. }
  24.  
  25.  
  26. // нажатие
  27. private View.OnClickListener guessButtonListener = new View.OnClickListener(){
  28. @Override
  29. public void onClick(View v){
  30.  
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement