When creating an overlay activity without specifying TID, there's an error about unpack.
Python 3.11.6, termuxgui 0.1.6 running on Android 12, MIUI 14.
The code that is not working as expected:
import termuxgui as tg
import time
def main():
with tg.Connection() as connection:
activity = tg.Activity(connection, overlay=True)
tv = tg.TextView(activity, "Hello world!")
time.sleep(10)
if __name__ == "__main__":
main()
Error:
Traceback (most recent call last):
File "/data/data/com.termux/files/home/mergebot/bot_gui_overlay.py", line 11, in <module>
main()
File "/data/data/com.termux/files/home/mergebot/bot_gui_overlay.py", line 6, in main
activity = tg.Activity(connection, overlay=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/termuxgui/activity.py", line 29, in __init__
self.aid, tid = self.c.send_read_msg({"method": "newActivity", "params": params})
^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable int object
Adding a random tid to the tg.Activity makes the overlay to appear and fix the problem
When creating an overlay activity without specifying TID, there's an error about unpack.
Python 3.11.6
,termuxgui 0.1.6
running on Android 12, MIUI 14.The code that is not working as expected:
Error:
Adding a random
tid
to thetg.Activity
makes the overlay to appear and fix the problemactivity = tg.Activity(connection, tid=123, overlay=True)
The overlay activity isn't documented in the TUTORIAL.md and would be useful.