Commit 523a9a3
committed
feat: Conditionally show 'AI stopped' toast
The 'The AI stopped Screen Operator' toast is now only displayed if:
- 'takeScreenshot()' is not in the AI message (case-insensitive).
- AND the PhotoReasoning screen is not visible.
To check if the app is in the foreground, the ActivityManager is used to analyze running processes. This is a standard Android method to determine the foreground status without requiring additional flags or lifecycle changes in other files.
Fixes unresolved reference to receiverContext.1 parent d904b41 commit 523a9a3
File tree
1 file changed
+5
-0
lines changed- app/src/main/kotlin/com/google/ai/sample/feature/multimodal
1 file changed
+5
-0
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
| |||
0 commit comments