Skip to content

Commit 33c4c7c

Browse files
authored
Merge pull request #2002 from reckoner1429/development
Fixes #2000 Fixed the repeated display of 'Not Connected' Toast messa…
2 parents 6f9c2ed + a1f8f59 commit 33c4c7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
107107
scienceLab = ScienceLabCommon.scienceLab;
108108
entries = new ArrayList<>();
109109
setupInstruments();
110+
if(!scienceLab.isConnected())
111+
Toast.makeText(getContext(), R.string.not_connected, Toast.LENGTH_SHORT).show();
110112
return rootView;
111113
}
112114

@@ -388,8 +390,6 @@ private void visualizeData() {
388390
mChart.moveViewToX(data.getEntryCount());
389391
mChart.invalidate();
390392
}
391-
} else {
392-
Toast.makeText(getContext(), R.string.not_connected, Toast.LENGTH_SHORT).show();
393393
}
394394
}
395395

0 commit comments

Comments
 (0)