android - How to simplify the method that does not use the if statement -


How to simplify the method which does not use the if statement and decreases the number of lines of my code How written:

  Private Zero RemoveImg () {While (true) {rel_with_images.getChildCount (); If ((number_of_Image == 5) {rel_with_images.removeViewAt (number_of_izays-); sp_1 = sp11.play (sp_1, 1.0F, 1.0F, 0, 0, 1.0F); int111 = sp11.play (intaa, 1.0F , 1.0 f, 0, 0, 1.0 f); checkbybet (); menact c5 = menact; this; c 5.number_off_iagases = (-1 + c5umber_of_image); brake;} if ((number_of_izab == 4) {rel_with_images} removeViewAt (number_ of_Image- 1); sp_1 = sp11.play (sp_1, 1.0F, 1.0F, 0, 0, 1.0F); inta11 = sp11.play (intaa, 1.0F, 1.0F, 0, 0, 1.0F); CheckVibrate (); Menact C5 = Menact. This, C 5.number_off_iize.c = (-1 + c5number_of_image); break;} if ((number_of_izab == 3) {rel_with_images.removeViewAt (number_o _iJes-1); sp_1 = sp11 game (1, 1.0 f, 1.0f, 0, 0, 1.0f); inta11 = sp11.play (intaa, 1.0F, 1.0F, 0, 0, 1.0F); checkwid ( ); Menact c 5 = menact;; C5.number_of_image = (-1 + c5.number_of_image); break;} if ((number_of_image == 2) {rel_with_images.removeViewAt (number_of_Image- 1); sp_1 = sp11.play (sp_1 , 1.0F, 1.0F, 0, 0, 1.0f); inta11 = sp11.play (intaa, 1.0F, 0f, 0, 0, 1.0f); CheckVibrate (); MainAct c5 = MainAct. this; c5.number_of_image = (-1 + c5.number_of_Image); break; } If ((number_of_image == 1) {rel_with_images.removeViewAt (number_of_Image- 1); sp_1 = sp11.play (sp_1, 1.0F, 1.0F, 0, 0, 1.0F); int111 = sp11.play (intaa, 1.0 F, 1.0F, 0, 0, 1.0F); CheckIbet (); Menact C5 = MainEct.Check; C 5.Number_of_IJes = (-1 + C5Number_of_Image); BRAKE;}}}  < / pre> 

is the number_of_Image integer that counts the number of pictures in relative layout relation_imes.The code is slightly larger when the layout has more than 30 images. Does anyone know a solution? Thanks

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -