I want to block my screen for listening a tap or click when the show.status("Please Wait",2 AnyTimeLimit); is invoked.
Actually I'm sending a hit to a web service and meanwhile I'm displaying a message "Please Wait" with 2 seconds wait. But after those 2 seconds It starts listening the tap/click. How can I block them to listen tapEvent/ClickEvent when displaying message?
Thanks,
You will have to make a custom screen that overrides PopupScreen
for that. In your implementation, you will have to override onUiEngineAttached
, like so -
protected void onUiEngineAttached(boolean attached)
{
super.onUiEngineAttached(attached);
if(attached)
{
// start server hit thread, which closes the screen when done
}
}
After that, just push the screen using UiApplication.getUiApplication.pushModalScreen()
. You will want to keep the data you received in a byte array somewhere in the screen's instance which you can retrieve by calling a getter once the screen has been popped.