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);` код работы кнопок
PhotoViewcan display only one image at a time. - YurySPb ♦