termux-notification set clipboard on action doesn't work
Problem description Trying to set the clipboard from a notification action but text is not set and the previous state is kept.
Steps to reproduce
From Termux: termux-notification --action "termux-clipboard-set some-text"
Expected behavior
After clicking the notification and running termux-clipboard-get or pasting anywhere, 'some-text' should be inserted
Additional information Android version: 9 CPU arch: aarch64
Can't reproduce. Do you have the latest termux-api android package and termux package? (i.e. update from play store/f-droid and pkg up in termux)
Yeah, I do have the app and the API updated. Altough, I forgot to mention that this happens only when termux is not showing in the phone screen, like in background.
I forgot to mention that this happens only when termux is not showing in the phone screen, like in background.
More like Android restriction for background application launch.
Currently, api commands just launch Termux:API application with passing some arguments through intent. That behaviour may not be desired by Android OS.
It may be useful (?) to generate a log (adb logcat) to check what is happening.
Having persistent API service may resolve the issue. There some work done for TermuxAPIService in https://github.com/termux/termux-api/pull/233.
Devs out here use clipboard set/get to check for foreground activity. Should those be changed, we'd need alternatives.