Programatically hide open overflow menu

25 views
Skip to first unread message

Bryan Buchanan

unread,
May 24, 2016, 8:52:11 AM5/24/16
to CodenameOne Discussions
In some of the commands in an overflow menu I want to have for the action event
               
Display.getInstance().dial(some_number);

or
               
Display.getInstance().openNativeNavigationApp(latitude,longitude);

There is a display issue that when you return to the app from the dialer or navigation app, the overflow menu is (sometimes) open and lowlighted. Sometimes it will close itself, and other times you need to tap on the screen and it will close. So, I wondering if there is something like:

           @Override
           
public void actionPerformed(ActionEvent evt) {
                getToolbar
().closeOverflowMenu();
               
Display.getInstance().dial(CommonContext.INSTANCE.getAddresses()[storeindex].callnumber);
           
}

to force close it before calling the external app, or is it better to send off the Display... command in a new thread ?

Shai Almog

unread,
May 25, 2016, 12:59:57 AM5/25/16
to CodenameOne Discussions
The close is automatic but sometimes these things happen because of the event chain which is still processing. Just postpone your call to the next EDT cycle by wrapping it in a callSerially call.
Reply all
Reply to author
Forward
0 new messages