Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法通过Android通知向后循环_Java_Android_String_Notifications_Android Notifications - Fatal编程技术网

Java 无法通过Android通知向后循环

Java 无法通过Android通知向后循环,java,android,string,notifications,android-notifications,Java,Android,String,Notifications,Android Notifications,我有一系列通知,一次显示两条,根据web服务调用的结果显示一系列总共6-10条指令。这部分代码运行良好。问题是,当在通知周期中向后单击时,如果您单击两个显示的通知中的任何一个,它将显示前两个通知。在步骤5中,它将不显示第五个通知,我很难确定原因 截图: 具体来源: private void setNotificationStrings(Bundle extras) { TelephonyManager tm = (TelephonyManager) getSystemService(TE

我有一系列通知,一次显示两条,根据web服务调用的结果显示一系列总共6-10条指令。这部分代码运行良好。问题是,当在通知周期中向后单击时,如果您单击两个显示的通知中的任何一个,它将显示前两个通知。在步骤5中,它将不显示第五个通知,我很难确定原因

截图:

具体来源:

private void setNotificationStrings(Bundle extras) {
    TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
    // The code below sets the values of the current (field and value),
    // previous, and beforePrevious
    // Those hold the strings to display in the 2 notifications and the
    // strings to go back to
    // if the user decides to back track
    if (i == count) {
        done = true;
    }
    if (extras != null) {
         if (((tm.getSimOperator()).equals(getString(R.string.numeric_tmo)))) {
            Log.w(TAG, "Extras not null");
            previousValue = extras.getString(getString(R.string.config_name_label));
            value = extras.getString(getString(R.string.apn_label));
            if (previousValue != null && value == null) {
                previousField = getString(R.string.config_name_label);
                previousValue = valuez.getAsString("name");
                Log.w("previousValue", previousValue);
                beforePreviousField = "step1";
                beforePreviousValue = "> New APN";
                //
                field = getString(R.string.apn_label);
                value = valuez.getAsString("apn");
                extras.clear();
                currentStep = 2;
                if (i == 1) {
                    j++;
                }
                Log.d("currentStep = ", " 2");
            } else {
                previousValue = extras.getString(getString(R.string.apn_label));
        if (proxyArr.size() > 0)// if proxy and port are not null
            value = extras.getString(getString(R.string.proxy_label));
        else {
            value = extras.getString(getString(R.string.mmsc_label));
            }
        if (previousValue != null && value == null) {
            previousField = getString(R.string.apn_label);
            beforePreviousField = getString(R.string.config_name_label);
                beforePreviousValue = valuez.getAsString("name");
            if (proxyArr.size() > 0) {
                field = getString(R.string.proxy_label);
            value = valuez.getAsString("proxy");
                } else {
                field = getString(R.string.mmsc_label);
                    value = valuez.getAsString("mmsc");
            }
            extras.clear();
            currentStep = 3;
            Log.d("currentStep = ", " 3");
            } else {
                if (proxyArr.size() > 0) {// if proxy and port are not
                                            // null
                previousValue = extras.getString(getString(R.string.apn_label));
                        value = extras.getString(getString(R.string.port_label));
                        if (previousValue != null && value == null) {
                previousField = getString(R.string.apn_label);
                beforePreviousField = getString(R.string.config_name_label);
                beforePreviousValue = valuez.getAsString("name");
                            field = getString(R.string.port_label);
                value = valuez.getAsString("port");
                extras.clear();
                currentStep = 4;
                Log.d("currentStep = ", " 4");
                        } else {
                            previousValue = extras.getString(getString(R.string.port_label));
                            value = extras.getString(getString(R.string.mmsc_label));
                            if (previousValue != null && value == null) {
                    previousField = getString(R.string.port_label);
                    beforePreviousField = getString(R.string.proxy_label);
                    beforePreviousValue = valuez.getAsString("proxy");
                                field = getString(R.string.mmsc_label);
                    value = valuez.getAsString("mmsc");
                    extras.clear();
                    currentStep = 5;
                    Log.d("currentStep = ", " 5");
                } else {
                                previousValue = extras.getString(getString(R.string.port_label));
                if (mmsproxyArr.size() > 0) {// if mmsproxy
                                // and
                                // mmsport
                                // are not
                                // null
                    value = extras.getString(getString(R.string.mms_proxy_label));
                } else {
                    value = extras.getString(getString(R.string.type_label));
                            }
                            if (previousValue != null && value == null) {
                            previousField = getString(R.string.mmsc_label);
                                beforePreviousField = getString(R.string.port_label);
                                beforePreviousValue = valuez.getAsString("port");
                                if (mmsproxyArr.size() > 0) {
                    field = getString(R.string.mms_proxy_label);
                    value = valuez.getAsString("mmsproxy");
                    } else {
                    field = getString(R.string.type_label);
                    value = getString(R.string.type);
                    }
                    extras.clear();
                                currentStep = 6;
                    if (i < nameArr.size() - 1 && currentStep == 6) {
                        i++;
                    Log.d("currentStep = ", " 6");
                    } else {
                    if (mmsproxyArr.size() > 0) {// if
                                    // mmsproxy
                                    // and
                                    // mmsport
                                    // are
                                    // not
                                    // null
                        previousValue = extras.getString(getString(R.string.mms_proxy_label));
                                        value = extras.getString(getString(R.string.mms_port_label));
                                        if (previousValue != null && value == null) {
                        previousField = getString(R.string.mms_proxy_label);        
                                            beforePreviousField = getString(R.string.mmsc_label);       
                                            beforePreviousValue = valuez.getAsString("mmsc");   
                                            field = getString(R.string.mms_port_label);                                         
                                            value = valuez.getAsString("mmsport");                                      
                                            extras.clear();                                                 
                                            currentStep = 7;                                        
                                            Log.d("currentStep = ", " 7");
                                        } else {                                            
                                            previousValue = extras.getString(getString(R.string.mms_port_label));           
                                            value = extras.getString(getString(R.string.type_label));                   
                                            if (previousValue != null && value == null) {                                               
                                                previousField = getString(R.string.mms_port_label);                                     
                                                beforePreviousField = getString(R.string.mms_proxy_label);                                                      
                                                beforePreviousValue = valuez.getAsString("mmsproxy");                       
                                                field = getString(R.string.type_label);                                                     
                                                value = getString(R.string.type);                                                       
                                                extras.clear();                                                 
                                                currentStep = 8;                                                    
                                                Log.d("currentStep = "," 8");
完整资料来源:


欢迎使用SO,用户2843378。谢谢:非常感谢。有人对此有什么建议吗?