Merge pull request #188 from OpenSeizureDetector/176-v426-crash-when-opening-app-from-notification

Added exception catching to updateUI in an attempt to fix #176
This commit is contained in:
Graham Jones
2024-05-08 21:59:54 +01:00
committed by GitHub

View File

@@ -111,7 +111,16 @@ public class FragmentOsdBaseClass extends Fragment {
updateUiHandler.post(new Runnable() {
@Override
public void run() {
updateUi();
// Check for context being null is an attempt to stop the crashes reported in Issue No 176
if (mContext != null) {
try {
updateUi();
} catch (Exception e) {
Log.e(TAG,"upateUiOnUiThread() - exception updating UI - "+e.getMessage());
}
} else {
Log.e(TAG,"updateUionUiThread() - mContext is null?? Can't show a Toast message because context is null....");
}
}
});
}