java - How to change the order of IF statments based on a variable (from server) -


sorry if it's noob question starting learning coding zero. there more concise way change order of if statement based on variable?

of course below code wondering if there way obtain similar result in more simple way instead of having write every single order combination. sorry again if question stupid.

if (mfirebaseremoteconfig.getstring(key) equals 1) {         if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }         if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }     } else if (mfirebaseremoteconfig.getstring(key) equals 2) {         if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }         if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }     } else if (mfirebaseremoteconfig.getstring(key) equals 3) {         if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }         if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }     } else if (mfirebaseremoteconfig.getstring(key) equals 4) {         if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }         if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }        } else if (mfirebaseremoteconfig.getstring(key) equals 5) {         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }            if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }            if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }                } else if (mfirebaseremoteconfig.getstring(key) equals 6) {         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }            if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }            if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }                        } 


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -