联新 pda的支持 已经 adapter 关闭的判断

This commit is contained in:
wujie
2023-08-21 13:35:56 +08:00
parent 3bc08317d0
commit 46199cda0f
4 changed files with 65 additions and 4 deletions

View File

@ -102,6 +102,8 @@ public class MainActivity extends AppCompatActivity implements ResultListener{
adapter = new ZebraAdapter(this, this);
case HISENSE:
adapter = new HisenseAdapter(this, this);
case LACHESIS:
adapter = new LachesisAdapter(this, this);
}
if (null != adapter) {
adapter.start();
@ -203,8 +205,10 @@ public class MainActivity extends AppCompatActivity implements ResultListener{
//webView.loadUrl(url());
// voiceEngine.reload();
super.onResume();
adapter.stop();
adapter.start();
if (adapter != null) {
adapter.stop();
adapter.start();
}
}
@Override
@ -214,7 +218,9 @@ public class MainActivity extends AppCompatActivity implements ResultListener{
}
@Override
protected void onDestroy() {
adapter.stop();
if (adapter != null) {
adapter.stop();
}
super.onDestroy();
if (diPlayer != null) {
diPlayer.stop();