Note that there are some explanatory texts on larger screens.

plurals
  1. POToggle though pictures using value of Count by button press
    primarykey
    data
    text
    <p>I have an app where I have 3 different picture galleries. The pictures are displayed when a button is pressed, this displays a count on screen telling the user what number picture they are looking at. The picture changes when the button is pressed and the count goes up. </p> <p>The problem is I have 3 different galleries, I want the next gallery of pics to start straightaway after the first one. So if I have 5 pics in gallery A, when the count reaches 5 and when the button is pressed again, I want the count to go back to 1 and onto the gallery B.</p> <p>Any ideas on how I can achieve this?</p> <p>Here is my code so far:</p> <pre><code>public class picgalleries &lt;onPause&gt; extends Activity { //Count Button TextView txtCount; ImageView image; Button btnCount; static int count=0; txtCount = (TextView)findViewById(R.id.count); txtCount.setText("This app has been started " + count + " times."); image = (ImageView) findViewById(R.id.imageview); btnCount = (Button)findViewById(R.id.click); count++; count = 1; image.setImageResource(R.drawable.image1gallerya); count = 2; image.setImageResource(R.drawable.image2gallerya); count = 3; image.setImageResource(R.drawable.image3gallerya); count = 4; image.setImageResource(R.drawable.image4gallerya); count = 5; image.setImageResource(R.drawable.image5gallerya); count = 1; image.setImageResource(R.drawable.image1galleryb); count = 2; image.setImageResource(R.drawable.image2galleryb); txtCount.setText(String.valueOf(count)); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload