I’m working on app. that gets info. about the caller by it’s number.
I have a slight problem that while cheking the info. about the caller the phone isn’t showing the basic incoming call screen.
I want to present an incoming call screen with one extra label.
First the label’s text will be ‘Searching’, and after I got the search result I want to change the label’s text according to the info. I found.
I tried to use phoneScreenPortrait.updateDisplay(), but nothing happend.
The code:
public void callIncoming(int callId) { ScreenModel screenModel = new ScreenModel(callId); PhoneScreen phoneScreenPortrait = screenModel.getPhoneScreen(PhoneScreen.PORTRAIT, PhoneScreen.INCOMING);String resName = ""; String callNum = Phone.getCall(callId).getDisplayPhoneNumber(); if( Phone.getCall(callId).getContact() != null ) //Contact found { screenModel.sendAllDataToScreen(); return; } LabelField callerName; callerName = new LabelField( "Searching" ) { public void paint(Graphics g) { g.setColor(Color.WHITE); super.paint(g); } }; callerName.setFont(phoneScreenPortrait.getCallerInfoFont()); phoneScreenPortrait.add(callerName); screenModel.sendAllDataToScreen(); try { resName = getName( callNum ); // Get's the name with my function } catch( Exception ex ) { System.out.println(ex.toString()); } if( resName == null ) resName = "No match.."; callerName.setText( resName ); phoneScreenPortrait.updateDisplay();}
Thanks,
Rotem
OK I managed to solve it myself..
After I set the LabelField’s text I added those lines: