private final String[] imageNames={"img1", "img2", "img3","img4", "img5", "img6"}; private int currentIndex; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); PhotoView photoView = (PhotoView) findViewById(R.id.photo_view); photoView.setImageResource(R.drawable.img1); } 

How to register in photoView.setImageResource(R.drawable.img1); all six photos?

 `private void previousImage() { if(currentIndex > 0) { currentIndex--; }else { Toast.makeText(getApplicationContext(), "No Previous Image", Toast.LENGTH_SHORT).show(); return; } this.showImage(currentIndex); } private void nextImage() { if(currentIndex < this.imageNames.length-1) { currentIndex++; }else { Toast.makeText(getApplicationContext(), "No Next Image", Toast.LENGTH_SHORT).show(); return; } this.showImage(currentIndex);` код работы кнопок 
  • And how should this look visually as a result? - eugeneek
  • PhotoView should work with all images, not with "img1". - Magatron3000
  • @Magatron3000, i.e. Need to flip them left and right? Or some button to switch to the next? So a single PhotoView can display only one image at a time. - YurySPb
  • There are buttons "Next" and "Previous", they scroll through the pictures. But with PhotoView, they do not work, there is only one (first) picture and that's it. How can I apply to all content? - Magatron3000
  • Show the code with these buttons and how they scroll through pictures without PhotoView. - eugeneek

0