验证后如何将其指向另一个页面?

时间:2015-03-10 17:39:50

标签: android

我希望将其转向另一类

if (rbSingle.isChecked() || rbMarried.isChecked()) {
                if (sqlName.getText().toString().length() == 0 && sqlcycle.getText().toString().length() == 0
                        && sqlperiod.getText().toString().length() == 0 && sqlAge.getText().toString().length() == 0 && tvper.getText().toString().length() == 0) {
                    sqlName.setError("Please Input Name");
                    sqlcycle.setError("Please Input your Cycle Length");
                    sqlperiod.setError("Please Input your Period");
                    sqlAge.setError("Put your Birthday");
                    tvper.setError("Put your first day of last period");
                } else if (sqlName.getText().toString().length() == 0 && sqlcycle.getText().toString().length() == 0) {
                    sqlName.setError("Please Input your Cycle Length");
                    sqlcycle.setError("Please Input your Period");
                } else if (sqlName.getText().toString().length() == 0 && sqlperiod.getText().toString().length() == 0) {
                    sqlName.setError("Please Input your Cycle Length");
                    sqlperiod.setError("Please Input your Period");
                } else if (sqlcycle.getText().toString().length() == 0 && sqlperiod.getText().toString().length() == 0) {
                    sqlcycle.setError("Please Input your Cycle Length");
                    sqlperiod.setError("Please Input your Period");
                } else if (sqlName.getText().toString().length() == 0) {
                    sqlName.setError("Please Input your Cycle Length");
                } else if (sqlcycle.getText().toString().length() == 0) {
                    sqlcycle.setError("Please Input your Cycle Length");
                } else if (sqlperiod.getText().toString().length() == 0) {
                    sqlperiod.setError("Please Input your Cycle Length");
                }
            } else if(sqlName.getText().toString().length() == 0
                    && sqlcycle.getText().toString().length() == 0 && sqlperiod.getText().toString().length() == 0) {
                Toast.makeText(getApplicationContext(), "Please select your Gender", Toast.LENGTH_SHORT).show();
                sqlName.setError("Please Input Name");
                sqlcycle.setError("Please Input your Cycle Length");
                sqlperiod.setError("Please Input your Period");
            }else{
                 Intent main = new Intent(this, CalendarMain.class);
                 startActivity(main);
                 finish();
            }

问题:为什么它不会指向另一个页面?在我想要它直接到CalendarMain类的编码之后。你可以在我的代码中指明问题是什么吗?

0 个答案:

没有答案