Fix RuntimeException when toggling At A Glance option

Resolves issue: "Screen id 0 already exists" error
This commit is contained in:
MrSluffy committed 2024-12-26 07:53:01 +08:00
1 parent 689d250d4b
commit eb6e45d7ca
1 file changed
+2 -1
+2 -1
View File
@@ -748,7 +748,8 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
public CellLayout insertNewWorkspaceScreen(int screenId, int insertIndex) {
if (mWorkspaceScreens.containsKey(screenId)) {
throw new RuntimeException("Screen id " + screenId + " already exists!");
Log.w(TAG, "Screen id " + screenId + " already exists, skipping insertion");
return mWorkspaceScreens.get(screenId);
}
// Inflate the cell layout, but do not add it automatically so that we can get