Skip to content

Commit ba19e2a

Browse files
author
Kunal
committed
toast in gas sensor corrected
1 parent 92f56a5 commit ba19e2a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/src/main/java/io/pslab/fragment/GasSensorDataFragment.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
9191
rootView = inflater.inflate(R.layout.fragment_gas_sensor, container, false);
9292
unbinder = ButterKnife.bind(this, rootView);
9393
scienceLab = ScienceLabCommon.scienceLab;
94+
if (!scienceLab.isConnected()) {
95+
Toast.makeText(getContext(), R.string.not_connected, Toast.LENGTH_SHORT).show();
96+
}
9497
entries = new ArrayList<>();
9598
setupInstruments();
9699
return rootView;
@@ -366,8 +369,6 @@ private void visualizeData() {
366369
mChart.moveViewToX(data.getEntryCount());
367370
mChart.invalidate();
368371
}
369-
} else {
370-
Toast.makeText(getContext(), R.string.not_connected, Toast.LENGTH_SHORT).show();
371372
}
372373
}
373374

0 commit comments

Comments
 (0)