|
@@ -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();
|