java - A method should return an empty string, but it is not an empty string. What does it return? -


private string getmyphonenumber(){     telephonymanager mtelephonymgr;     mtelephonymgr = (telephonymanager)             getsystemservice(context.telephony_service);     return mtelephonymgr.getline1number(); }  

this method should return phone number or null, when try check returned parameter, see not empty string:

public void setmyphonenumber(){     if (getmyphonenumber() == null){         myphonenumberdialog();     } else {         myphonenumber = getmyphonenumber();         toast(getmyphonenumber());     } } 

what method return?

returns phone number string line 1, example, msisdn gsm phone. return null if unavailable.

--documentation

null isn't equal "" (empty string).


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -