notes-android icon indicating copy to clipboard operation
notes-android copied to clipboard

Crash when using the "New Note" quick settings tile: `UnsupportedOperationException: startActivityAndCollapse: Starting activity from TileService using an Intent is not allowed`

Open scottpk opened this issue 1 year ago • 1 comments

This issue respects the following points:

Describe the bug

  1. Pull down the shade.
  2. Tap "New Note" tile.
  3. Notes does not open.
  4. After several seconds a crash occurs.

Expected behavior

This always used to go straight to the "New Note" intent.

Notes Android version

4.2.0

Notes server version

4.9.0

Nextcloud Android version

3.28.1

Nextcloud version

28.0.4

Device

ASUS Zenfone 10

Android Version

14

App Store

  • [X] Google Play Store
  • [ ] F-Droid
  • [ ] Huawei App Gallery

Stacktrace

App Version: 4.2.0
App Version Code: 40020090
App Flavor: play

Files App Version Code: 30280190 (PROD)

---

OS Version: 5.15.94-android13-8-00003-g2ac3c8c88d7f-ab10835385(34.1004.0204.128)
OS API Level: 34
Device: ASUS_AI2302
Manufacturer: asus
Model (and Product): ASUS_AI2302 (WW_AI2302)

---

java.lang.UnsupportedOperationException: startActivityAndCollapse: Starting activity from TileService using an Intent is not allowed.
	at android.service.quicksettings.TileService.startActivityAndCollapse(TileService.java:355)
	at it.niedermann.owncloud.notes.quicksettings.NewNoteTileService.lambda$onClick$0(NewNoteTileService.java:28)
	at it.niedermann.owncloud.notes.quicksettings.NewNoteTileService.$r8$lambda$BH0XsYJVdPGqpiaACS8tJGfTX0c(Unknown Source:0)
	at it.niedermann.owncloud.notes.quicksettings.NewNoteTileService$$ExternalSyntheticLambda0.run(Unknown Source:4)
	at android.service.quicksettings.TileService$H.handleMessage(TileService.java:499)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:245)
	at android.os.Looper.loop(Looper.java:364)
	at android.app.ActivityThread.main(ActivityThread.java:8427)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:977)

scottpk avatar Apr 09 '24 03:04 scottpk

Appears to be due to Android 14:

https://stackoverflow.com/a/77548094 https://developer.android.com/reference/android/service/quicksettings/TileService#startActivityAndCollapse(android.content.Intent)

joshtrichards avatar Apr 18 '25 16:04 joshtrichards