wei-spring / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Generated "Back" command disappears from menu on Android when returning from next form #1015

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On Android a "Back" menu item is automagically added when navigating from one 
Form to the next. When returning from the next form, however, this menu item is 
not added.

What steps will reproduce the problem?
1. Use Designer to create 3 forms which navigate to the next form using 
Commands.
2. Run the application on Android emulator (or on an Android device).
3. Navigate from Form1 to Form2. The menu of Form2 now shows a Back command.
4. Navigate from Form2 to Form3, and then back to Form2.
5. The menu of Form2 does not include the Back command anymore.

What is the expected output? What do you see instead?
At least I would like the behaviour to be consistent across forward and 
backward navigation. But since Android devices include a dedicated Back button, 
I would not expect an additional Back button to be added to the menu at all. 
(This also potentially implies a L10N issue, as the menu item should be in the 
right language.)

What version of the product are you using? On what operating system?
CodenameOne 1.1 Designer Build 20131224 on Windows 8.1.

Please provide any additional information below.
(None)

Original issue reported on code.google.com by timo.van...@gmail.com on 5 Jan 2014 at 4:19

GoogleCodeExporter commented 9 years ago
I've added a method: protected boolean shouldAddBackCommandToMenu()
which you can override in the state machine to return false. 
Unfortunately this piece of code is something that breaks so many different 
things its really hard to make a sweeping change by default.

Original comment by shai.almog on 6 Jan 2014 at 6:24

GoogleCodeExporter commented 9 years ago
Thanks Shai for the quick solution!

Original comment by timo.van...@gmail.com on 7 Jan 2014 at 8:58

GoogleCodeExporter commented 9 years ago
Despite waiting for a while and updating both the libraries and tools, the 
promised "protected boolean shouldAddBackCommandToMenu()" is not visible in my 
development environment. (Neither StateMachineBase nor UIBuilder contains this 
method.)

Am I doing something wrong?

Original comment by timo.van...@gmail.com on 13 Jan 2014 at 12:52

GoogleCodeExporter commented 9 years ago
We last updated the plugin in January 4th. 1 day before you submitted. 

Original comment by shai.almog on 15 Jan 2014 at 6:38

GoogleCodeExporter commented 9 years ago
Ok, I should wait for the next plugin release.
No problem; I thought I missed something.

When is the next release scheduled?

Original comment by timo.van...@gmail.com on 15 Jan 2014 at 6:43

GoogleCodeExporter commented 9 years ago
Either this weekend or early next week.

Original comment by shai.almog on 15 Jan 2014 at 6:49