Skip to content

Commit

Permalink
android: fixed app exiting when about to show toast
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Nov 23, 2024
1 parent b2e26e8 commit 5fff349
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/android/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"vscode": {
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools", "vscjava.vscode-java-pack"]
}
}
},
"runArgs": ["--privileged", "--network=host"]
}
8 changes: 4 additions & 4 deletions app/android/src/com/introlab/rtabmap/RTABMapActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1775,19 +1775,19 @@ public void onClick(DialogInterface dialog, int which) {
long currentTime = System.currentTimeMillis()/1000;
if(loopClosureId > 0)
{
if (mToast != null && mToast.getView().isShown()) mToast.cancel();
if (mToast != null) mToast.cancel();
mToast.setText(String.format("Loop closure detected! (%d/%d inliers)", inliers, matches));
mToast.show();
}
else if(landmarkDetected != 0)
{
if (mToast != null && mToast.getView().isShown()) mToast.cancel();
if (mToast != null) mToast.cancel();
mToast.setText(String.format("Marker %d detected!", landmarkDetected));
mToast.show();
}
else if(rejected > 0)
{
if (mToast != null && mToast.getView().isShown()) mToast.cancel();
if (mToast != null) mToast.cancel();
if(inliers >= Integer.parseInt(mMinInliers))
{
if(optimizationMaxError > 0.0f)
Expand All @@ -1809,7 +1809,7 @@ else if(fastMovement)
{
if(currentTime - mLastFastMovementNotificationStamp > 3)
{
if (mToast != null && mToast.getView().isShown()) mToast.cancel();
if (mToast != null) mToast.cancel();
mToast.setText("Move slower... blurry images are not added to map (\"Settings->Mapping...->Maximum Motion Speed\" is enabled).");
mToast.show();
}
Expand Down

0 comments on commit 5fff349

Please sign in to comment.