Skip to content Skip to sidebar Skip to footer

Android Imageview Setvisibility

i want to change visibility of imageview if value= x but i have error message on eclipse. here is part of my java if (success == 1) { // product

Solution 1:

Use cu.equals("1") rather than cu == "1" and you'll be fine

Solution 2:

For that you have to check if you are taking string for compression than use .equalsIgnoreCase("") function otherwise use == to compare .

Solution 3:

You are checking for a String in which case the .equals("your_constraint") is used.

So, change this:

if (cu == "1") {
    cu = "oui";
} else {
    ImageViewimage_A_wrong= (ImageView) findViewById(R.id.imageView1);
    image_A_wrong.setVisibility(View.GONE);
}

to this:

if (cu.equals("1")) {
    cu = "oui";
} else {
    ImageView image_A_wrong = (ImageView) findViewById(R.id.imageView1);
    image_A_wrong.setVisibility(View.GONE);
}

Post a Comment for "Android Imageview Setvisibility"