• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Nested if statement won't work.

Brian Berry

Well-Known Member
The following nested if statement won't fire. even if I change it to 1==1 it still doesn't work. Can anybody spot the problem? My Log statement "x sum 22" reports the correct value but the nested if statement doesn't if or else its as though it's not there. This is the weirdest thing I've ever seen.


Java:
if (!global0.getLockPile1().equals("lock_pile1") && global0.getPlayer1Cards0().size()<=0) {


                        hit0.hitSplitPileTwo0(context0, global0);
                        global0.setHitSplitCou1(global0.getHitSplitCou1() + 1);

                        int p1Sum11 = calculateCards0.calculateCards00(global0.getSplitPile1(), context0, global0);
                        Log.e("x sum 22", String.valueOf(p1Sum11)+" >>>"+global0.getSplitPile1());

                        global0.reSetCouCards0();
                        global0.reSetCalcSum0();



                        if(p1Sum11<= 21) {

                            Log.e("hit","hit 2");

                            //do nothing
                        } else {
Log.e("bust for pile 1","bust 0");
                            //bust
                            global0.setPressCou0(global0.getPressCou0()+1);
                            global0.setLockPile0("lock_pile1");

                            global0.setStayLock0("unlock_stay_button0");
                            global0.getStayBtn0().setAlpha((float) 1);

                            global0.setHitBtnLock0("unlock_hit_button0");
                            global0.getHitBtn0().setAlpha((float) 1);
                            deal0.dealToP2P3P4P5(context0, global0);
                            Log.e("this that","this that other 2");
                        }
                    }
 
For future reference - Rather than use log statements, running your app in debug mode and using breakpoints to trace the execution of your code is a much more efficient and productive way to diagnose problems in your code.
 
Back
Top Bottom