Browse Source

<修改分机概率性出现通话时界面未刷新问题>

weizhengliang 4 years ago
parent
commit
a91671a4fd

+ 2 - 1
app/src/main/AndroidManifest.xml

@@ -61,7 +61,8 @@
         tools:replace="android:icon">
 
         <activity android:name="com.wdkl.callingbed2.ui.CallingBedActivity"
-            android:screenOrientation="landscape"></activity>
+            android:screenOrientation="landscape"
+            android:launchMode="singleTask"></activity>
 
         <activity android:name="com.wdkl.callingbed2.ui.APPUpdateActivity"
             android:screenOrientation="landscape"

+ 12 - 3
app/src/main/java/com/wdkl/callingbed2/ui/CallingBedActivity.java

@@ -698,12 +698,11 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
     @Override
     protected void initUtil() {
         serialPortUtil = ((MyApplication) this.getApplication()).serialPortUtil;
-        serialPortUtil.setOnDataReceiveListener(this);
-        iMediaPlayerVolume = this;
-
         if (serialPortUtil != null) {
+            serialPortUtil.setOnDataReceiveListener(this);
             setDoorLight(serialPortUtil, "111");//初始化白色
         }
+        iMediaPlayerVolume = this;
 
         //设置语言
         textToSpeech = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
@@ -720,6 +719,15 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
     }
 
     @Override
+    protected void onNewIntent(Intent intent) {
+        super.onNewIntent(intent);
+        if (serialPortUtil != null) {
+            serialPortUtil.setOnDataReceiveListener(this);
+        }
+        iMediaPlayerVolume = this;
+    }
+
+    @Override
     protected void initData() {
         //以太网和wifi切换
         changeNetConnect();
@@ -1958,6 +1966,7 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
         VoiceManagerUtil.setCallVoice(CallingBedActivity.this, Integer.parseInt(Constants.BEDCALLVOICE));
         //刷新呼叫超时时间
         callTimeOut = (StringUtils.parseInt(Constants.CALLINGTIMEOUT) == 0 ? 180000 : StringUtils.parseInt(Constants.CALLINGTIMEOUT) * 1000);
+        callTimeOutBack = (StringUtils.parseInt(Constants.CALLINGTIMEOUT) <= 0 ? 180 : StringUtils.parseInt(Constants.CALLINGTIMEOUT));
     }
 
     private void updateNursingBackground() {