Bladeren bron

<修改分机概率性出现通话接通后界面无变化>

weizhengliang 4 jaren geleden
bovenliggende
commit
d6419b056b

+ 1 - 1
app/build.gradle

@@ -25,7 +25,7 @@ android {
         minSdkVersion 15
         targetSdkVersion 26
         versionCode 1
-        versionName "1.36"
+        versionName "1.37"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 
         buildConfigField "String", "BUILD_TIME", getDate()

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

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

+ 13 - 3
app/src/main/java/com/wdkl/callingbed/ui/CallingBedActivity.java

@@ -591,13 +591,13 @@ 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() {
             @Override
@@ -613,6 +613,16 @@ 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();