Darkempire78 / OpenCalc

A simple and beautiful calculator for Android
GNU General Public License v3.0
726 stars 81 forks source link

Starting activity from TileService using an Intent is not allowed. #415

Open bashuser30 opened 3 months ago

bashuser30 commented 3 months ago

Describe the bug I am unable to launch the app using the Quick Tile.

To Reproduce Steps to reproduce the behavior:

  1. Click on the tile.
  2. Get error and logs.

Expected behavior App opens from tile press.

Smartphone (please complete the following information):

Additional context Here are logs from the crash:

type: crash
osVersion: google/cheetah/cheetah:14/UQ1A.240105.004/2024011600:user/release-keys
package: com.darkempire78.opencalculator:42
process: com.darkempire78.opencalculator
processUptime: 2317 + 273 ms
installer: com.machiav3lli.fdroid

java.lang.UnsupportedOperationException: startActivityAndCollapse: Starting activity from TileService using an Intent is not allowed.
    at android.service.quicksettings.TileService.startActivityAndCollapse(TileService.java:355)
    at com.darkempire78.opencalculator.MyTileService.onClick(Unknown Source:21)
    at android.service.quicksettings.TileService$H.handleMessage(TileService.java:494)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8279)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ExecInit.main(ExecInit.java:49)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
inson1 commented 3 months ago

Its bug, because of the new android version

https://stackoverflow.com/questions/77547985/launch-an-activity-from-tileservice-for-android-14-is-not-allowed

muryno commented 2 months ago

I have a fix for this here MR