Skip to content

Commit 3a94cd7

Browse files
authored
Merge pull request #2215 from t-arn/android_create_app_commands
Android: moved app command creation to method _create_app_commands()
2 parents 536a60f + cdc8cb6 commit 3a94cd7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

android/src/toga_android/app.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ def create(self):
177177
self._listener = TogaApp(self)
178178
# Call user code to populate the main window
179179
self.interface._startup()
180+
self._create_app_commands()
180181

182+
def create_menus(self):
183+
self.native.invalidateOptionsMenu() # Triggers onPrepareOptionsMenu
184+
185+
def _create_app_commands(self):
181186
self.interface.commands.add(
182187
# About should be the last item in the menu, in a section on its own.
183188
Command(
@@ -187,9 +192,6 @@ def create(self):
187192
),
188193
)
189194

190-
def create_menus(self):
191-
self.native.invalidateOptionsMenu() # Triggers onPrepareOptionsMenu
192-
193195
def main_loop(self):
194196
# In order to support user asyncio code, start the Python/Android cooperative event loop.
195197
self.loop.run_forever_cooperatively()

changes/2215.misc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
On Android the creation of the app commands has been moved to the method _create_app_commands()

0 commit comments

Comments
 (0)