Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9207321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:21:43+00:00 2026-06-18T00:21:43+00:00

I try to update my imageiew using buttons private void visitUpdateImage(int type) { if(type

  • 0

I try to update my imageiew using buttons

private void visitUpdateImage(int type) {

if(type == 0){
    if(ecran != 1){
        ecran--;
    }
}
else if(type == 1){
    if(ecran != nbEcrans){
        ecran++;
    }
}

int[] images = new int[nbEcrans];
images[0] = R.drawable.ecran1;
images[1] = R.drawable.ecran2;
images[2] = R.drawable.ecran3;
images[3] = R.drawable.ecran4;
images[4] = R.drawable.ecran5;
images[5] = R.drawable.ecran6;
images[6] = R.drawable.ecran7;

ImageView image = (ImageView) findViewById(R.id.imageView);

image.setImageResource(images[ecran - 1]);

System.out.println(ecran);

}

The begining is good but images[5] il loading ic_launcher instead of ecran6 and the image[6] load nothing

I have all my ecrans in all my drawable repositories

Thanks for help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:21:45+00:00Added an answer on June 18, 2026 at 12:21 am

    Just guessing (Your conditions are wrong) Use:

    if(type == 0){
        if(ecran != 0){ //min is 0
            ecran--;
        }
    }
    else if(type == 1){
        if(ecran != nbEcrans-1){ //max is nbEcrans-1
            ecran++;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to update database table and this is my code: public void updatefiletable(String
I try to update a table using another table. I get the error number
I have a DAO class which I'm using to try select/update/insert with hibernate and
I am using SQL Server 2000. When I try to update a column of
When I try to install/update any plugin from Help -> Install New Software I
I try to update twice with same data but it throw exception public void
I try to update certain parts of a file without everything else being deleted
I try to update a column in an table with the following query. In
I try to update my profile image and use this code: $connection->post('account/update_profile_image', array('image' =>
I try to update a project from SVN (I have a fresh install of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.