Skip to content

Commit 1a4f1e1

Browse files
ActivityNavigator: support pre-instantiated activities
1 parent d94f5c0 commit 1a4f1e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal_filesystem/lib/mpos/activity_navigator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ def startActivityForResult(intent, result_callback):
4747
@staticmethod
4848
def _launch_activity(intent, result_callback=None):
4949
"""Launch an activity and set up result callback."""
50-
activity = intent.activity_class()
50+
activity = intent.activity_class
51+
if callable(activity):
52+
# Instantiate the class if necessary
53+
activity = activity()
5154
activity.intent = intent
5255
activity._result_callback = result_callback # Pass callback to activity
5356
start_time = utime.ticks_ms()

0 commit comments

Comments
 (0)