I have found a solution to my problem, and thought I'd post it in case someone else was trying to do the same thing. It's hacky, but better than nothing for now. Basically in my phone listener I have:
Code:
public void callIncoming(int callId)
{
UiApplication.getUiApplication().pushGlobalScreen(new Screen2(), 0, UiEngine.GLOBAL_MODAL);
} And then in in the Screen2 class I override onObscured:
Code:
protected void onObscured(){
Screen activeScreen = TestListener.getUiApplication().getActiveScreen();
activeScreen.getUiEngine().suspendPainting(true);
TestListener.getApplication().requestForeground();
} I pop off my screen once the user has answered or ignored the call:
Code:
protected void onExposed(){
TestListener.getUiApplication().popScreen(this);
} And to get the the UI to repaint again once the user has answered or ignored the call, in the phone listener I put:
Code:
public void callAnswered(int arg0) {
Screen activeScreen = TestListener.getUiApplication().getActiveScreen();
if(activeScreen.getUiEngine().isPaintingSuspended()){
activeScreen.getUiEngine().suspendPainting(false);
}
activeScreen.doPaint();
}
I also put that bit of code in the callbacks for callFailed and callDisconnected.
There is probably still some tweaking I'm going to do - like put in checks to make sure the phone app is the screen on top when i suspend painting, and I'm not sure I really need to call doPaint() and requestForeground() in some places, or which of the callbacks I need to put it in, but it seems to be working fairly well, with no strange behavior other than that the screen which lists missed/made calls pops up afterwards.
Thanks everyone who took the time to reply and make suggestions.
