06-03-2012 05:21 AM
Hey,
I read the above API and I would like to know what will getPhoneNumber() method will return if the phone number associated with this phone call is private or unknown?
Will it always return empty string?
I think it will be nice to mention it in the API.
Thanks,
Rotem
06-04-2012 02:36 AM
06-04-2012 09:01 AM - edited 06-04-2012 09:10 AM
Hi,
I tried to test it myself for hours..
When I used the simulator it returned 'Anonymous-'[call index] (1,2,etc..) .
When I used my real device it returned nothing, altough when I compared the returned string to empty string it wasn't true.
This is the code I used:
number = Phone.getCall(callId).getPhoneNumber();
String txt;
if( number.indexOf("Anonymous") == -1 )
txt = number;
else if( number == null )
txt = "null";
else if( number.equals("") )
txt = "empty";
else
txt = "Private or Unknown";
numLbl = new LabelField( "*" + txt + "*" )
More ideas?
Thanks,
Rotem